Android: How can I make the application multilingual?

Possible duplicate:
How to create a multilingual Android app?

I am building an application and I am in the testing phase, but I want to make my application multilingual.

How can I make it multilingual? What is the best way to do this?

+4
source share
3 answers

What you need to do is create new folders in the res folder.

Example. If you need to add support for Spanish and Italian, you need to do it as follows:

  • res folder

    1.1 values

    1.2 values-es // spanish

    1.3 values-it // italian

And after that you need to create string.xml files in values-es and values-it . And in all files, you just need to create the whole line that you want to use as follows:

 <string name="title">Title</string> // in values folder <string name="title">Title in Spanish</string> // in values-es folder and etc. 

And after that you can use this line as:

 TextView text = (TextView) findViewById(R.id.textView); text.setText(getString(R.string.title)); 

And that should work.

+4
source

Take a look at this app localization guide: http://developer.android.com/resources/tutorials/localization/index.html .

Perhaps this helps.

+3
source

Numerous examples are available to help you create a multilingual Android app.

Take a look at these articles:

http://developer.android.com/resources/tutorials/localization/index.html

http://www.icanlocalize.com/site/tutorials/android-application-localization-tutorial/

this will help you create a multilingual Android app.

+1
source

Source: https://habr.com/ru/post/1391284/


All Articles