Android gives us the facility to support different languages in your application. The solution is very easy, you just have to define separate values folder for each language and define every String there. You need to add a hyphen and ISO language code with values folder like Values-fr or values es.
At run time, android will load it according to the settings of the device.
These are the example to add different language compatibility.
English (default locale), /values/strings.xml:
<!--?xml version="1.0" encoding="utf-8"?-->
<resources>
<string name="title">My Application</string>
<string name="hello_world">Hello World!</string>
</resources>
Spanish, /values-es/strings.xml:
<!--?xml version="1.0" encoding="utf-8"?-->
<resources>
<string name="title">Mi Aplicacin</string>
<string name="hello_world">Hola Mundo!</string>
</resources>
0 Comment(s)