Published: Thu, May 04, 2017
World | By Tasha Manning

Android Studio Tricks: How to change the LANGUAGE of our Android application in Android Studio. Automatic adaptation by country.

Android Studio Tricks: How to change the LANGUAGE of our Android application in Android Studio. Automatic adaptation by country.

Today's entry speaks of one of the most important things to take into account when creating a good app: the translation and adaptation of our application for each country.

It's simple: more languages, more countries can be distributed, more public. So I'll show you the way to do it step by step. Let's start.

- You have to have ISO 639-1 codes for each country / language. It will also serve -2 and -3. Android Studio can recognize all these codes and you have to go testing until the country flag is displayed (see below):

Now, create a new STRING.XLM file where we will translate each STRING into The language we want.

In Android Studio, we must create the new VALUES resource directories that are within RES and host the STRINGS.XLM resources:

Fast Rx Online
To avoid this, please always send an email to sales@meds.com.mx along with your order number and the fact that you made a payment. All medications that you find on our websites are over the counter medications and do not require a prescription here in Mexico.

- Right click on RES - & gt; New resource directory - & gt; And in the same name VALUES we add a script and the code of the country (first column, although we must try until we see the country flag right next to the resource STRING) - & gt; Copy the default resource where all our STRINGS are in our main language - & gt; Paste into the new folder VALUES- (code) directory of the new language - & gt; Translate each STRING

- We open the tab:

- And it appears with the flag:

- We can now modify each STRING of the new STRING resource .XLM that will be read by the device according to the language settings chosen by the user:

I suggest that you do the compilation test on an external PC device (connected via USB) and you can change the language and See if you have successfully completed translations. Greetings to everyone by the visit!

Like this: