Create locale directories and resource files
To add support for more locales, create additional directories inside res/. Each directory's name should adhere to the following format:
<resource type>-b+<language code>[+<country code>]
For example, values-b+es/ contains string resources for locales with the language code es. Similarly, mipmap-b+es+ES/ contains icons for locales with the es language code and the ES country code. Android loads the appropriate resources according to the locale settings of the device at runtime. For more information, see Providing Alternative Resources.
After you’ve decided on the locales to support, create the resource subdirectories and files. For example:
MyProject/
res/
values/
strings.xml
values-b+es/
strings.xml
mipmap/
country_flag.png
mipmap-b+es+ES/
country_flag.png
For example, the following are some different resource files for different languages:
English strings (default locale), /values/strings.xml:
<resources>
<string name="hello_world">Hello World!</string>
</resources>
Spanish strings (es locale), /values-es/strings.xml:
<resources>
<string name="hello_world">¡Hola Mundo!</string>
</resources>
United States' flag icon (default locale), /mipmap/country_flag.png:
Figure 2. Icon used for the default (en_US) locale
Spain's flag icon (es_ES locale), /mipmap-b+es+ES/country_flag.png:
Figure 3. Icon used for the es_ES locale