12

How to change the name of the applications on that screen which appears on clicking Launcher Icon on Home Screen in Android according to the language selected in Settings(Settings->Language & Keyboard) of Phone? In other words, if we make application "Abhishek" & select "French" language in Settings of phone, then name of the application on that screen should display in french. Thanks in advance for help.

abhishek kumar gupta
  • 1,915
  • 6
  • 27
  • 50

5 Answers5

15

you simply have to store the Strings.xml in a folder with the countrycode eg one Strings.xml in values-en one in values-fr and one in values-de. The app will automatically pic the folder with the right country-code according to the phone language

2red13
  • 10,616
  • 7
  • 37
  • 52
  • Thanks for reply, but I want to see the change in the language on the screen which contains(show) all the installed applications(i.e. on the screen which appears on clicking Launcher Icon on the Home Screen). – abhishek kumar gupta Apr 06 '11 at 05:45
  • 1
    yes, that's waht we talking about, the String wich is displayed at the home screen is located in the strings.xml (string name="app_name") if you do what we wrote, the values-fr String will appear on the Homescreen if French is the Systemlanguage and so on. – 2red13 Apr 06 '11 at 06:41
  • You will in many cases also need to reboot the phone after changing the language for the changes to take effect, if you have merely switched the language and reinstalled the app. – user43633 Mar 05 '15 at 12:02
  • For those who needs specific types of languages, such as English UK/French Canadian, this link helped: http://stackoverflow.com/questions/6676393/localization-codes-does-not-work – kretzm Oct 01 '15 at 01:13
11

I think what Abhishek is looking for is how to make the app name string parametrizable.

Have this in your manifest file:

android:label="@string/app_name"

And then for each language file add:

<string name="app_name">Your app name</string>

See original answer here https://stackoverflow.com/a/5443324/988219

Community
  • 1
  • 1
Breiz
  • 1,053
  • 2
  • 11
  • 26
  • I created multilanguage app in React Native. But forgot about app_name localization. Default language is EN (other lang in app is PL). If I will create new release version (with value-bXX folder) when user update app. should the application update smoothly or will be problem (as in Emulator) with created second app icons (two separate app version). In EN (old) and new one in PL. Sorry for non technical questions ;) – Adam Mar 11 '18 at 22:27
  • This is the best answer. – Dpedrinha Nov 12 '19 at 01:57
3

see the link:

Localization

Basically you create different folders like values-fr or values-de which has xml files where you define the values (of say strings.xml) in the desired language(fr - for french, de - for germany..etc). You'll have to search manually for these translations and include in the strings file.

Vicky Kapadia
  • 5,709
  • 2
  • 21
  • 30
  • Thanks for reply, but I want to see the change in the language on the screen which contains(show) all the installed applications(i.e. on the screen which appears on clicking Launcher Icon on the Home Screen). – abhishek kumar gupta Apr 06 '11 at 05:46
  • The installed apps will show a change in language only if you have wriiten strings file for all of them in the different languages. The emulator does not automatically show a change in language. Still in all its inbuilt apps a change in language would be visible. get it? – Vicky Kapadia Apr 06 '11 at 10:22
0

In MainActivity.java

app_title (updated lang strings file) is not updating

Tried many and nothing worked Finally this gave a temporary fix

Adding custom title by updating action-bar title

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setTitle(R.string.main_title);

where main_title is copy of app_title in Strings

djsreeraj
  • 505
  • 4
  • 13
0

you can change the ActionBar title name

getSupportActionBar().setTitle(R.string.app_name);

but changing the name of application while changing the language is not possible.

Amir Dora.
  • 2,358
  • 4
  • 28
  • 47
jitu
  • 1
  • 1