- How to implement Android system l10n ?It has been l10n in German.What is different between Android and Linux in realizing system localization?
- What is Operational process of implementing Android l10n ?
- What is needed to implement Android system localization? such as Unicode UTF8, charset,other anything else?
2 Answers
Are you asking about internationalization/localization? If so there's a pretty extensive writeup in the docs.
2 Comments
Localization in Android is a native function, what you have to understand is how to "tell android" where to pick the words translated based on the Language that is set on the device that is running your application.
1. When developing an application for Android avoid "hardcoding" the string values and always use the strings.xml file located in the res/values folder. In that file enter every string used in your application using the tag:
<string name="app_title">Super App</string> 2. From the java side use this string resources from anywhere with the method getString(), this method receives as parameter the id of the item you want to get:
getString(R.string.app_title) 3. Once you have defined every string your app will use, just copy the strings.xml file and paste it in a new folder at the same level of the res/values folder but name it according to the new language you want to add (Read this)
4. Finally, translate every string in each folder to the proper language but keeping the same ids of every string, just changing its content:
res/values-EN/strings.xml <string name="app_title">Best Application Ever!</string> res/values-ES/strings.xml <string name="app_title">La Mejor Aplicación!</string> res/values-FR/strings.xml <string name="app_title">Meilleure Application Jamais!</string>