Localization in android application - android

There is question.
I am working on localization (locale language specification) in my sample android app.
following this http://developer.android.com/training/basics/supporting-devices/languages.html
What i am doing, created three value folders.
1-values-fr
string.xml
2-values-de
string.xml
3-values-nl
string.xml
in default values string.xml having three strings
<string name="btn">OK</string>
<string name="btn_back">Back</string>
<string name="btn_next">Next</string>
for values-fr:-
<string name="btn">bien</string>
<string name="btn_back">arrière</string>
<string name="btn_next">suivant</string>
Now i am converting my english word to french words and putted them in to values-fr string.xml
I think this very headache work translate every english word into french or other language and then put in to string.xml.
Here is question FOCUS:- This is only the way to do this or we have some other ways

You can automatically translate your strings.xml using Translator Toolkit. You can read about it here.
If you just want to see the values in different languages in one table then you can check Sequoyah plugin. It has Sequoyah Android Localization Editor tool that shows all string keys and respective values in different languages in one table. The information about Sequoyah project is located here: http://eclipse.org/sequoyah Installation guide is here: http://eclipse.org/sequoyah/downloads/index.php#update_site.

You may try OneSky to solve the problem you mentioned.
It’s very easy.
Upload your English .xml file
Translate (you can translate online using ouronline editor or order machine/ human translation)
When the translation process is completed, the system will generate all the .xml files in different languages for you automatically
You can download all the translation as a single zip file. It already includes the necessary folder structure that can be directly used for your app
Our platform is free to use, unless you decide to order translation service from us.
Disclaimer: I’m an employee at OneSky

Related

What if the string.xml not contain enough language strings

i am trying to translate my Chinese app to English language....i used apk tool and decompiled them already, but the res/value/ string.xml not contain enough strings for the whole app...so i want to know anywhere in APK file that contain the language file like string.xml?

Android localization resources

I have just finished developing an android application that I was asked to make. I had also planned to translate it in different languages; below you can see the tree of the folders/files:
Inside strings.xml there are all the values that I am using inside the classes and they are all in Italian, my language (Here you can see an example if needed). I'd like to be able to translate all those fields in English and french as well.
I have read this article -> http://developer.android.com/training/basics/supporting-devices/languages.html
From what I have understood, I'd have to create a folder called values-fr with a strings.xml inside (it will have the same values names, but different translations).
QUESTION
I would like to be able to support English and Italian as well, but I don't understand how to manage the folders. Could you please tell me which option is the correct?
Inside the folder values use strings.xml with Italian (my language) strings. Then create another folder called values-en and, like I did before, create strings.xml with English values
Inside the folder values use strings.xml with English strings. Then create another folder called values-it and then, create strings.xml with Italian values
I guess that the point 2 is the correct solution but I'm not sure. The folder values has English as default language?
Thanks for the attention.
Technically speaking both are valid. values/ is the fallback if a more specific qualifier is not found. There is no written rule that enforces you in having the English strings in values/. It just makes a little more sense to have the English as fallback since it easier to find foreigners that speak English rather than Italian

Convert android project to multi-language

I have an Android project that I developed one year ago. I didn't think in do the project multi-language and now I need support it.
There are any easy way to detect all strings and generate the XML file? Or I need modify the project string for string?
The project is developed in Eclipse.
Android provides a very simple way to localize apps: string resources.
You need to provide several strings.xml files.
Each in a directory called /res/values-xy, where xy is the language (i.e.: es, fr, en, de, it, ...).
Then just refer these strings in your project, like R.string.my_string_name (in Java) or #string/my_string_name (in xml)
For reference: http://developer.android.com/training/basics/supporting-devices/languages.html
[EDIT]
Same goes for arrays: just use /res/values-xy/arrays.xml
Note: the names strings.xml and arrays.xml are just conventional ones can be changed to anything you like better.
AFAIK You need to modify the strings in your project manually. If you have hard-coded strings in your layouts then you can use Lint to find out all the hard-coded strings. Put them then into values/strings and the translation should go to the respective folder of each language.
EDIT:
If you're running Eclipse you can use the search feature to help you track all your hard-coded String. Check this topic

Android Multilanguage support

I have android application developed in English language and also have content in English. Is this possible that all texts are converted in other language like in Chinese or Japanese, then How? some sample code or tutorial will help me lot.
I am able to get language selected through setting with code as follows.
Locale.getDefault().getDisplayLanguage()
The usual way to do this is to:
Enter your strings in a strings.xml file in the /res/values/ folder of your project. You can then define different localizations of your string file by added them to the localized /res/values/ folders. ( /res/values-jp/ or /res/values-en/ etc.)
See: Developer Android
We can also use translation api. Refer this Link
http://www.creatiosoft.com/how-to-use-microsoft-translation-api-in-android/

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

Categories

Resources