How to change the name of application in Launcher in android according to the language selected in Settings of Phone?
Asked Answered
V

5

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.

Vulgarize answered 5/4, 2011 at 12:38 Comment(0)
P
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

Prater answered 5/4, 2011 at 12:45 Comment(4)
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).Vulgarize
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.Prater
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.Bassarisk
For those who needs specific types of languages, such as English UK/French Canadian, this link helped: #6676893Question
G
15

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://mcmap.net/q/73894/-how-to-change-an-android-app-39-s-name

Griefstricken answered 2/10, 2012 at 22:38 Comment(2)
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 ;)Cogwheel
This is the best answer.Apoloniaapolune
S
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.

Strop answered 5/4, 2011 at 12:47 Comment(2)
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).Vulgarize
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?Strop
M
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

Mask answered 5/1, 2018 at 11:18 Comment(0)
A
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.

Aeschines answered 15/5, 2021 at 17:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.