• 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?

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.
 
  • Like
Reactions: Unforgiven
Upvote 0
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:
Upvote 0
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.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones