Tuesday, 28 May 2013

multi language android

 multi language android is easy to config. Once you’ve decided on the languages you will support, create the resource subdirectories and string resource files.
Create additional values directories inside res/ that include a hyphen and the ISO country code at the end of the directory name. See ISO country code
 
For example:
 
MyProject/
    res/
       values/
           strings.xml
       values-es/
           strings.xml
       values-fr/
           strings.xml
 
 
 

For example, the following are some different string resource files for different languages.


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 Aplicación</string>
   
<string name="hello_world">Hola Mundo!</string>
</resources>
 

1 comment:

  1. I think https://poeditor.com can help with your l10n projects and simplify your workflow.

    ReplyDelete