Reputation: 394
I have made an app.(base version Gingerbread 2.3) and now I want to embed different languages to it so that the user can use the app. in different languages. But the process of embedding different languages is not clear to me(I'm a new to android programming), somebody please explain it in details with code.
Upvotes: 1
Views: 237
Reputation: 27748
This is a good tutorial to get you started: http://www.icanlocalize.com/site/tutorials/android-application-localization-tutorial/
Essentially, you need to create individual values
folders for all the languages you wish to support.
For example, if you are supporting French along with the default English, then, you will need to create a values-fr
folder. If you wish to support region specific languages, then you will need to create those too. For example, French language with the Region set to Canada, then you will need to create this: values-fr-rCA
How this works is:
1. If the Region is set to Canada and the Language
is set to French, the OS will look for the values folder: values-fr-rCA
2. If the above is not found, it looks for values-fr
.
3. If none of the above are found, it defaults back to the normal values
folder.
You will need to code your Strings.XML for all the values you use throughout your application. ** Hard-coded** strings will not be switch to other Languages.
The same goes for drawables
too.
Read more about Localization here
Upvotes: 1
Reputation: 9507
Multi language support is easy done for android. Create a new values
directory for the language with the suffix of the language code. For german: values-de
or french: values-fr
than copy your strings.xml
into that and translate each entry.
For more information refer this.
Upvotes: 1