Multilingual app in Android

Android considers English as primary language by default and loads the string resources from res ⇒ values ⇒ strings.xml. When you want to add support for another language, you need to create a values folder by appending an Hyphen and the ISO language code. For example if you want to add support for Urdu, you should create a values folder named values-ur and keep a strings.xml file in it with all the strings translated into French language.

So for example if in your strings.xml you have a value like

<string name=”new_equipment”>Nouveau Équipement</string>

the corresponding entry in strings-ur.xml would be

<string name=”new_equipment”> نئی مشین</string>

After created respective strings.xml files for all your supported languages all you have to do is change the Language under the Settings ⇒ Language & Input and it will change the language of the app.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s