Possible Duplicate:
How can I create a multilingual android application?
I am creating 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 make it ?
Multilanguage support is easy done for android. Create a new values directory for the language with the suffix of the language code. For german: values-de or french: values-fr than copy your string. xml into that and translate each entry.
Android 4.1 (Jelly Bean) introduced limited support for bidirectional text in TextView and EditText elements, allowing apps to display and edit text in both left-to-right (LTR) and right-to-left (RTL) scripts.
The thing that you need to do is to create new folders in your res
folder.
Example : If you need to add support to spanish and italian you need to do it like this :
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 all string which you want to use like this :
<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 these string as :
TextView text = (TextView) findViewById(R.id.textView);
text.setText(getString(R.string.title));
And this should work.
Take a look at this tutorial about localizing applications: http://developer.android.com/resources/tutorials/localization/index.html.
Maybe it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With