Saikumar
Saikumar

Reputation: 897

Multiple Language Support Android APP

I am very new for developing the multi-language oriented Android APP. This is the first time i am going to support my app in multi-support language app. I need some clarification for developing the multi-language support app. Already i have some ideas before initiate the development.

  1. Single APK with Localization like will make the multiple String.xml and include it in inside of the app and based the member selection of language its automatically invokes and works.

  2. All language strings values will retain in app server (back-end) and will raise the Rest-API request and get those values and change it inside of the entire app (all screens) if member click and change the language inside of the app.

Main concern is if anything needs to change in future then Idea2 is best way. We will just change in back-end side it will be appeared in client side. But if we are going Idea1 and wants to change then we need to put the new build only.

Which one is best approach and recommended way to develop?

Upvotes: 0

Views: 2510

Answers (3)

Mohamed El-shiekh
Mohamed El-shiekh

Reputation: 72

right click the values folder and choose new-> values resource file -> locale -> choose the language you want and name it strings.

copy the strings from the original string file to the new file and change them to the new language just the strings

make sure that the view xml files have their text set as "@string/the_name of the string" not hard coded

Upvotes: 0

Gastón Saillén
Gastón Saillén

Reputation: 13159

You will need to create different String.xml depending the languages you want to target as JDenais says, in my app i have the following

enter image description here

for example the first arab string consist in the same as Strings.xml but with all in arab, now, you only need to call one string in your xml files and it will just select where to grab depending on the phone language. Or in default the language from where the app was downloaded by google play, in fact, they are all the same strings.xml , so you dont need to specify which one you want to pull the translated text from, just replicate your main strings.xml in your other strings.xml and then the phone will decide where to pull the data.

enter image description here

Also please read the official doc on how to accomplish this https://developer.android.com/training/basics/supporting-devices/languages

Also please check the language ISO Codes here

What is the list of supported languages/locales on Android?

Upvotes: 2

JDenais
JDenais

Reputation: 3016

All your texts should be packaged in the APK in different String.xml files. Forget about receiving texts from a backend. It would be a lot of extra work for limited gain and with added risks of failure.

The framework takes care of selecting the appropriate string.xml file and offers support for needed use cases like plurals.

Upvotes: 1

Related Questions