Application Localization - Android Studio

To make Android applications multilingual; make translated text strings file in values. After translation process , Android Operating System will pick the assets that match client’s or user language. In the event that your application is accessible in a few languages, Android operating system will choose the language that the tally with the device language. Android Operating System loads content/text/strings and media assets from the undertaker's ‘res’ folder. Also, Android can choose and stack assets from various folder, in light of the present device configuration and area like language.


Localization of Text:
Create folder with the prefix name of locale you want to translate like
  1. ‘res/values-en/strings.xml’
  2. ‘res/values/strings.xml’
  3. ‘res/values-pk/strings.xml’  For urdu
  4. ‘res/values-in/strings.xml’  For Hindi
Create string.xml in every folder. Register strings in every string.xml with same name and having translated text in its tags.
Refer that string tags name from XML layout.
Localization of Images:
Our application likewise needs more drawable folder, each containing a variation of the images used in application.Place images that needs to show up for a particular languages or locale in relating folder under the undertaking work space.
This way, translators can translate just the texts, and you can rebuild the localized images.

Background image
Destination folder in project workspace
Italian
drawable-it-rIT/background.jpeg
French
drawable-fr-rFR/background.jpeg
French (Canada)
drawable-fr-rCA/background.jpeg
English (Canada)
drawable-en-rCA/background.jpeg
Russian
drawable-ru-rRU/background.jpeg
US English
drawable-en-rUS/background.jpeg
Default
drawable/background.jpeg

Sample Folder



Comments

Post a Comment