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.
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
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
see the link:
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.
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
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.
© 2022 - 2024 — McMap. All rights reserved.