Android Building Multi-Language Supported App

Android is one of the few popular mobile operating systems having millions of users over 190 countries and growing day by day. So when you are aiming your app to be globally successful, it is always a good idea to make the app localized.

While localizing, you should consider using appropriate text, audio, currency, numbers and graphics depending upon the region or country. But this tutorial only covers localizing strings i.e supporting multiple languages. Localizing with Resources explains about other things should be considered when localizing your app.

In this article we are going to build a Multi-Language supported app that supports French, Deutsch (German), Hindi and Japanese.

VIDEO DEMO

1. How String Localization Works

By default android considers English as primary language and loads the string resources from res ⇒ values ⇒ strings.xml. When you want to add support for another language, you need to create a values folder by appending an Hyphen and the ISO language code. For example if you want to add support for French, you should create a values folder named values-fr and keep a strings.xml file in it with all the strings translated into French language.

3. Under drawable folder create three files named bg_button_rounded.xml,bg_form_rounded.xml, bg_gradient.xml with following contents. These files are not related to language support, but just to give nice gradients background and rounded corners to buttons, input boxes.

Hi there! I am Founder at androidhive and programming enthusiast. My skills includes Android, iOS, PHP, Ruby on Rails and lot more. If you have any idea that you would want me to develop? Let’s talk: ravi@androidhive.info

You have to build your own keyboard or fork the git code and do the modifications.

Rahul Dswebapp

“You have to build your own keyboard” i don’t know how to build it. any example that help me?

Prateek Jaiswal

hello Ravi, this is defined in xml but what if the hindi content coming from db and it shown in version greater than 4.4 but in 4.4 it is know showing hindi content. Can you suggest something which solves my issue?

Keith Presley

Hi Ravi,
Looking to set an editText component to another language other than the device’s language and present the soft keyboard of the editText’s language when in focus.
Is this possible?
Many thanks
Keith

Vanaja Menon

Hi Ravi ,
I want to show diiferent language news in recyclerview,where news are taken from json
Is this Possible?