Create Android App With Multiple Language Support Example Tutorial

How to automatically change app language by detecting android mobile phone device language.

There are hundred types of languages in the world and some of them is very common and famous and can be understand by millions of peoples but when we want to make even more effective and user friendly android application then we need to choose the most common user friendly gate way that is called as Make an android app which can support different type of langues. If our android app support various type of common langues then it can be used by more peoples. So here is the complete step by step tutorial for Create Android App With Multiple Language Support Example Tutorial.

android-project-download-code-button

What we are doing in project: We are creating an android app which can automatically detect android mobile phone default system language and according to that it will change its language same as device language. But there is one condition it will be change in only when you have defined that particular another language in your app, So read all the below institutions very carefully.

List of most common used languages ISO codes with strings.xml folder path.

Serial NoLanguage NameISO Codevalues/strings.xml folder path.
1Arabicarvalues-ar/strings.xml
2Bulgarianbgvalues-bg/strings.xml
3Catalancavalues-ca/strings.xml
4Czechcsvalues-cs/strings.xml
5Danishdavalues-da/strings.xml
6Germandevalues-de/strings.xml
7Spanish esvalues-es/strings.xml
8Finnishfivalues-fi/strings.xml
9Frenchfrvalues-fr/strings.xml
10Hebrewiwvalues-iw/strings.xml
11Hindihivalues-hi/strings.xml
12Croatianhrvalues-hr/strings.xml
13Hungarianhuvalues-hu/strings.xml
14Indonesianinvalues-in/strings.xml
15Italianitvalues-it/strings.xml
16Japanesejavalues-ja/strings.xml
17Koreankovalues-ko/strings.xml
18Lithuanianltvalues-lt/strings.xml
19Latvianlvvalues-lv/strings.xml
20Norwegian nbvalues-nb/strings.xml
21Dutchnlvalues-nl/strings.xml
22Polish plvalues-pl/strings.xml
23Portugueseptvalues-pt/strings.xml
24Romanianrovalues-ro/strings.xml
25Russian ruvalues-ru/strings.xml
26Slovakskvalues-sk/strings.xml
27Slovenianslvalues-sl/strings.xml
28Serbian srvalues-sr/strings.xml
29Swedishsvvalues-sv/strings.xml
30Thaithvalues-th/strings.xml
31Tagalogtlvalues-tl/strings.xml
32Turkishtrvalues-tr/strings.xml
33Ukrainianukvalues-uk/strings.xml
34Vietnamesevivalues-vi/strings.xml
35Chinesezhvalues-zh/strings.xml

Source : https://goo.gl/vcliIY

Note : As you can see above table shows us all the folder structure of string.xml file which we have to create manually inside our project to make our android app supported by that particular language.

Screenshot of project after creating languages folder :

language_values_folder_string

How to Create Android App With Multiple Language Support Example Tutorial.

Code for MainActivity.java file.

package com.android_examples.multiplelanguage_android_examplescom;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


    }
}

Code for activity_main.xml layout file.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.android_examples.multiplelanguage_android_examplescom.MainActivity"
    android:background="#9C27B0">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="@string/app_Title"
        android:id="@+id/textView"
        android:gravity="center"
        android:textSize="30dp"
        android:textStyle="bold"
        android:background="@drawable/rounded_textview"
        android:padding="10dp"
        android:layout_marginTop="48dp"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="@string/Title_Tag"
        android:id="@+id/textView2"
        android:textColor="#FFFFFF"
        android:textSize="25dp"
        android:textStyle="bold"
        android:gravity="center"
        android:layout_below="@+id/textView"
        android:layout_alignLeft="@+id/textView"
        android:layout_alignStart="@+id/textView"
        android:layout_marginTop="37dp" />
</RelativeLayout>

Code for values/strings.xml file .

<resources>
    <string name="app_name">MultipleLanguage-Android-Examples.com</string>

    <string name="app_Title">Android App With Multiple Languages Support.</string>

    <string name="Title_Tag">The language of This application will be automatically change according to your default device language.</string>
</resources>

Code for values-fr/strings.xml file.

<resources>
    <string name="app_name">MultipleLanguage-Android-Examples.com</string>

    <string name="app_Title">App Android avec plusieurs langues de soutien.</string>

    <string name="Title_Tag">La langue de cette application sera automatiquement changer en fonction de votre langue par défaut du périphérique.</string>
</resources>

Code for values-hi/strings.xml file.

<resources>
    <string name="app_name">MultipleLanguage-Android-Examples.com</string>

    <string name="app_Title"> एकाधिक भाषाओं के साथ एंड्रॉयड ऐप समर्थित </string>

    <string name="Title_Tag">इस आवेदन की भाषा स्वचालित रूप से आपके डिफ़ॉल्ट डिवाइस भाषा के अनुसार परिवर्तन हो जाएगा .</string>
</resources>

Code for values-ja/strings.xml file.

<resources>
    <string name="app_name">MultipleLanguage-Android-Examples.com</string>

    <string name="app_Title">複数言語のサポート付きのAndroidアプリ</string>

    <string name="Title_Tag">このアプリケーションの言語が自動的にデフォルトのデバイスの言語に応じて変化します.</string>
</resources>

Screenshot in English Language :

Create Android App With Multiple Language Support in Example Tutorial

 

Screenshot in French Language :

french-language

 

Screenshot in Hindi Language :

hindi-language

 

Screenshot in Japanese Language :

japanese-language

Click here to download Create Android App With Multiple Language Support in Example Tutorial with source code.

Leave a Reply

Your email address will not be published. Required fields are marked *