• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Best way to add multilanguage support?

Hello,

what is the best way to add multi-language support to an application? Sorry if it is obvious, I started working
on Android only some weeks ago.
 
There's some kind of service I think where people donate their language skills like a crowd sourcing thing but I can't for the life of me remember the name. Is it "crowdin"?
 
I would do the translation myself as in the family we speak 4 languages. I was thinking more from an implementation perspective.
 
I moved this to the development forum. Seems other coders would be best suited to help you out.:)
 
Android Studio has a language editor. As long as you're not hardcoding your text, you can use the editor to translate. When you open your strings.xml android studio presents you with a button at the top to open the translator to start translating.

If you need to translate to other languages you don't speak add a link in your play store listing letting users of your app know that they can help translate to their language. Then have the link take them to your site for example where you provide the strings and an email for the them to submit the translations. This way you get it done for free.
 
As @GameTheory mentioned, if you should not hardcoding your text which should be placed in res/values/string.xml . This is the origin string file.
You should create several language folders in res , for example , res/values-zh-rCN (for Chinese),res/values-de-rDE(for German),etc. A strings.xml file should be created in each of these folders .
Next, translate the text in the origin string file and put them in the strings.xml in the according language folder.
for example:
values/strings.xml

Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="hello">hello</string>
    <string name="bye">bye</string>
</resources>

and we should translate the string and place it in others language strings.xml

res/values-zh-rCN/strings.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="hello">你好</string>
    <string name="bye">再见</string>
</resources>
res/values-de-rDE/strings.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="hello">Hallo</string>
    <string name="bye">Auf Wiedersehen</string>
</resources>
you can translate as many languages as you like , just create the according files to support it .
you can switch the displaying language by the following code:
Code:
            getAppContext().setLocaleSetting(Locale.ENGLISH); //switch to English
            getAppContext().setLocaleSetting(Locale.SIMPLIFIED_CHINESE); //switch to Chinese
 
Last edited:
I have a question. I'm using Eclipse and I'm wondering which method do you guys use to print out texts on screen. The method I'm using right now or the font I'm using doesn't print out characters other than the basic english letters, numbers, and punctuation. The font itself is a .fnt file. I tried to include all characters but it seems like it'll take more than 10MB in space, and I'm reluctant to do it and is seeking other methods.
 
Back
Top Bottom