I have a need to find a solution to a problem with app_name
my android project.
The idea is that I should be able to have app_name
both for English and for Spanish, but it only allows me for one. Any way out?
I have a need to find a solution to a problem with app_name
my android project.
The idea is that I should be able to have app_name
both for English and for Spanish, but it only allows me for one. Any way out?
To solve this problem, it would be enough to make the app support several languages. For this you can take a look at the android documentation .
For your specific App name problem, you can do the following:
In your Manifest you must make use of the string resources, so that the device takes the corresponding language automatically, for this it is used
@string/
, remaining as follows:On the other hand, to add support for more languages, you'll need to create additional values directories inside res/ that include a hyphen and the ISO language code at the end of the directory name. Like for example values-en , being as follows:
Finally you will have to add the string values for each locale in the corresponding file. For example:
Spanish (default locale), /values/strings.xml:
English, /values-en/strings.xml:
I hope it helps you
For that case you can use multilanguage support by defining a named string
app_name
in each strings.xml file defined for a different language.These texts in addition to the name of the application can be applied to others in the application.
Multilanguage support on Android
The localization scheme requires you to create folders and files containing the text and its identifier in different languages as required, which will be supported by your application.
For example, if we suppose that our application supports English, Spanish and Romanian languages, we must have the following folders....
The default text folder would be:
The folder to add the texts in English:
would contain:
The folder to add the texts in Spanish is:
would contain:
The folder to add the Romanian texts:
would contain:
You would have something similar to this in your project:
You simply use those descriptions defined in your
strings.xml
application wherever it is required in your application:strings.xml
The great advantage is that automatically, depending on the language defined in your operating system, it loads the defined texts in the corresponding language file .