Android internationalization-developing in Android Studio

How Should I apply internationalization to an Android app,using various languages?

I need to develop an Android application where the original words in Portuguese should be translated into the following languages : German,Arabic(Saudi Arabia),Chinese,Greek and Italian!

I already have a file: strings inside my values folder.xml.. and I created the folder for the languages(where are the corresponding strings), but when I emulate the applications nas foreign languages the words continue in Portuguese!

My strings from each of the countries already have the translated words, so much so that the files when they open have the icon of the flag of the countries!

Below is the image of how the{[2] folders are named]}

Folder

<string name="app_name">Esercizio di internazionalizzazione</string>
<string name="país">Italia</string>
<string name="comida">Pizza</string>
<string name="food">Pizza</string>
<string name="bandeira">Bandiera dell\'Italia</string>



 <string name="app_name">Exercício Internacionalização</string>
    <string name="país">Brasil</string>
    <string name="comida">Feijoada</string>
    <string name="bandeira">Bandeira do Brasil</string>
    <string name="food">Feijoada</string>

Is there a correct way to name the folders? Am I taking any wrong steps?

Author: Carol M, 2019-03-07

2 answers

Application resources are loaded at application startup and component creation, according to the settings defined in the system. To test your app in Chinese, one of the simplest alternatives is to set the system language to Chinese and open the app again.

You can also change the language settings of the application programmatically (at runtime) as explained in the post How to change the language on Android at runtime and don't go mad , which includes code snippets for different API levels.

Folders must be named according to the standard BCP 47 . Try using values-ar, values-de, values-el, values-it and values-zh.

 1
Author: Mathias Berwig, 2019-03-07 20:56:11

It took me to come close to the question, sorry! I managed to figure out the error,I had not put @string in Id and Description!

 0
Author: Carol M, 2019-03-14 18:06:39