Create Android app in multiple languages - android

I have submitted an Android app to Google Play and I see that I can create different descriptions for each language it supports. My question is: can I create a different APK for each language? Alternatively, how can I detect the user's preferred language, so that I can automatically activate that language for the user in the app?

Here is the official tutorial for localizing your app. :)

You can create a different apk for each language ( split-apk ) - but I would not recommend this. Better use the platform function for this and put your strings file in the right path ( values- ) - after this everything is automagically done

no just use the /res/values/strings.xml
for example to choose english language create a folder in same directory of values and call it values-en, for frensh values-fr and so on. the default language of the app is under values/

And if (for some reason) you still need to know witch is the devices language use
Locale.getDefault().getDisplayLanguage();

Related

Catalan and Basque strings in Android not being used [duplicate]

When you want to add locale-specific resources in Android, you have to add the lowercase ISO-3166-1 code of the language to the resource folder's name. So far so good.
Now I want to add Catalan and Basque strings to my application. According to the ISO list, I would have to add values-ca and values-eu. But will that work, actually?
Edit: With a custom language chooser in your app, you can provide support for languages even when they're not in the device's settings menu. I've made the library that I use for this available on GitHub:
https://github.com/delight-im/Android-Languages
I don't know if Android supports all ISO codes and if these "minor" languages will be displayed at all. If Android is not available in these languages, perhaps the device will not even recognize this language as its default locale and just use es for Spanish.
Can someone help?
Many devices ship with a limited selection of languages in the settings menu, but can actually be set to any system locale using an app such as LocaleSwitch.
It should be pretty easy to test whether Basque is supported by adding a custom locale in LocaleSwitch and then adding the resource folder to see if the system loads the resources from this folder automatically.
Finally, Gingerbread 'support' for Catalan may only reference the inclusion of android.R values since 2.3, though I can't see them in the framework repository.
Actually not all languages are documented at Android docs and many brands did your custom version of Android which may change its list, but be sure that if a device has Catalan and/or Basque suports it will use ISO standard, and the values will got rigth as it is converted with string comparision.
Maybe it would be a good choice to put a handed changer if you got that most devices do not have this support on your tests.
The thing is, if the language is not listed in the language selection list on the device, the resources can never be used as the device can never be put in this configuration by the user.
On the other hand, if the device allows you to select Basque, it will be using this format, and your resources will be used.
We can now create our "values-eu-rES" folder and have our app in Basque, Android Lollipop has made it.
We can create a folder
Basque strings ->
value-eu [Basque]
another folder
Catalan strings ->
value-ca [Catalan]
Adding a new language in LocaleSwitch, you need to type the ISO 639-1 code. For instance, if you want to switch to basque you need to enter "eu". Afterwards, you will see the new locale as "vasco".
That makes me think that basque locale is supported by android.

How to Properly Support English when Localizing an App?

I'm working on localizing an Android app.
For arguments sake, let's say the app will support English, Albanian, and Bengali.
Currently all English strings are listed in the "default value" column of the translations editor:
Apps on the app store generally state what locales they support.
I'm assuming when you submit an app that either a person or machine verifies your claims... so...
Is it necessary to explicitly add English (en) locale/column in addition to the default values (just as Albanian and Bengali have been added in the photo) in order for the app to be considered to officially "support" English?
You do not have to add English locale to have it in Supported Language menu. Check documentations out.
When your Java code refers to strings, the system would load strings from the default (en_US) resource file, even if the app has Spanish resources localized under es_ES. This is because when the system cannot find an exact match, it continues to look for resources by stripping the country code off the locale. Finally, if no match is found, the system falls back to the default, which is en_US.
The system would also default to en_US if the user chose a language that the app didn't support at all, like French.
Default locale is en_US.
No.
Apps on the app store generally state what locales they support.
If you are talking about Apple's App Store, Google Play won't list the supported languages in similar fashion.
However, you can localize the store listing page. According to play console help, If a user's language preference matches the translation languages you've added, they'll see your app's translated version. You can also add localized graphic assets for your store listing pages. See this for more. This feature is similar to App Store's metadata localization.
There is an easy solution to your problem.
Just find the path in your project:
res/
and add a folder named:
values-en
Then add a file named:
strings.xml
Finally, it will look like this:
res/values-en/strings.xml
And the resources in it will show when the user's language setting is English.

Android app support multiple languages

If I want to upload my Android app with an aim of supporting multiple languages, do I have to upload multiple .apks, each designed for the language I would like to support, or do I implement it all into one .apk file?
Note: My app is a game and does not really not contain any Strings in the UI. The UI was made using Photoshop, eg the buttons with text and so on.
If I pack all the languages into one .apk file, how do I check which language the app should use?
Update:
All my images are stored in the assets folder of my project. How would I localize them?
No, you don't need to create multiple APKs, just single APK with Localization, see this http://developer.android.com/training/basics/supporting-devices/languages.html
and this http://developer.android.com/guide/topics/resources/localization.html
before given your question answer,i tell you about multilingual in android basically in android application work in region wise means if i have device in usa -> install one application ->once it install if application was developed for multilingual support then it automatically render those string.
-> now question is how application build in multilingual for that you have to define string.xml for each language for your application will supports.
--for example : res/values <= default
--for Spanish : res/values-es
--for your question answer : if you define image with static way then it does not work.
For games that have images containing text you can use the same method as for normal strings.
Lets say, for strings you will have a strings.xml file under
values-en
values-es
values-de
values-fr
Then for images you can use (beware of the qualifiers precedence)
drawable-es-hdpi
drawable-en-hdpi
drawable-de-hdpi
drawable-fr-hdpi
However this will make your app bigger.
What I usually do is to generate the images programmatically, using a background and then rendering the text using some custom font on top of it. Even if the images are textures to be used on a 3D engine it works fine and I believe is a more reasonable approach.

Translation tool

am wondering if is possible to use a feature on my app that can translate the app to other languages so the user can select through a list of languages so as he can read the app even if he doesnt speak English, thanks a lot
If you use the framework's localization facilities, this will happen automatically based on the user's language setting on their device
http://developer.android.com/guide/topics/resources/localization.html
Basically, instead of using string literals in your code (ie. txt.setText("Something") or android:text="Something"), you create these in your strings.xml file and use the automatically created reference id's.
res/values/strings.xml:
<string name="something">Something</string>
Then, you create alternate res/values folders for the other languages you support and create a similar strings.xml file there.
res/values-es/strings.xml
<string name="something">Algo</string>
Then your layouts and codes would have txt.setText(R.string.something) or android:text="#string/something".
You can do the same thing for drawable, layout, menu, etc.
"to use a feature on my app that can translate the app to other languages"
I do not think such feature exist from Google. But if you write the app according Google's localization guide then you can use our Nativer app, which is designed exactly for that. It takes you language resources - translates with a machine and then let's the crowd to correct it. All these happens in runtime - so you do not need to bother when the language translation finished by the crowd. You can find further info here transround.com
Peter

How to use multiple languages in android

I want to give my user an option to select his language and according to his selection i want to display language.
Can my android app support multiple languages. How to do that?
What you are referring to is termed Localization
You can do it under your resource folder. For example, let's say you want to have language support for France. For such cases, you can do it by creating a folder res/values-fr/strings.xml. In addition, you can have a folder called res/drawables-fr, as well.
You can check out more on these sites.
http://developer.android.com/resources/tutorials/localization/index.html
http://www.icanlocalize.com/site/tutorials/android-application-localization-tutorial

Categories

Resources