What if the string.xml not contain enough language strings - android

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?

Related

Android app language localization

I have developed an app. Now I want to support other regional languages in it. But now the app is almost ready, changing each java file to set the texts in the textview for the corresponding language is a big pain. Is there any other simple way to do that? Like making a different string.xml file and doing some stuff, then all the views will get changed???
Create alternative resources
A large part of localizing an app is providing alternative text for different languages. In some cases you also provide alternative graphics, sounds, layouts, and other locale-specific resources.
An app can specify many res// directories, each with different qualifiers. To create an alternative resource for a different locale, you use a qualifier that specifies a language or a language-region combination. (The name of a resource directory must conform to the naming scheme described in Providing Alternative Resources, or else your app cannot compile.)
Example:
Suppose that your app's default language is English. Suppose also that you want to localize all the text in your app to French, and most of the text in your app (everything except the app's title) to Japanese. In this case, you could create three alternative strings.xml files, each stored in a locale-specific resource directory:
res/values/strings.xml Contains English text for all the strings
that the app uses, including text for a string named title.
res/values-fr/strings.xml Contain French text for all the strings,
including title.
res/values-ja/strings.xml Contain Japanese text for
all the strings except title.
If your Java-based code refers to R.string.title, here is what happens at runtime:
If the device is set to any language other than French, Android loads title from the res/values/strings.xml file.
If the device is set to French, Android loads title from the res/values-fr/strings.xml file.
Notice that if the device is set to Japanese, Android looks for title in the res/values-ja/strings.xml file. But because no such string is included in that file, Android falls back to the default, and loads title in English from the res/values/strings.xml file.
If you properly used resource references (like R.string.hello) You can create another language configuration and it should be properly loaded. If you "hard coded" strings within JAVA code with literals like "hello world" You have quite a bit of refactoring to do.

How give an opportunity localize my library

Given: library, which open own frames (fragments and activities), with own text fields and strings. Library has three files strings.xml for localization regions, where speak in English, Russian and Ukrainian.
Needs: give for user opportunity localize my library. I can't keep more languages, so it must do library's user.
Variant of solution: create Java-class with all text values (I has bit strings). User can set in this class values from his strings files and it take opportunity to localize by strings.xml file. But this varian so uncomfortable for user.
Question: how give for user opportunity to localize my library's strings?
I can solved this problem. I try to create in project (where uses library) folder with name values-de and put in folder strings.xml with strings names from library, but with another values. And it worked!
So: project-library can use values from project, if then defined with same names, which they defined in library-resources.

Android - res/values-ja/strings.xml font issue

I need to support multiple languages in my native app. I could properly create strings.xml file in their respective folders for various languages (Italian, Spanish, Portuguese, etc.). However, I have tough time in creating strings.xml under values-ja folder for Japanese language.
I have strings in japanese font in word document. When I copy these strings to strings.xml file in eclipse, the strings are replaced with junk characters (i assume it is due to japanese font missing in eclipse or wrong encoding). I googled for hours but couldn't find a way to fix it.
any help will be appreciated.
You have to save the strings.xml in UTF-8 format.
Follow this guide in order to save your file as a text file using the right encoding. than you can open it in eclipse or notepad to do the your copy paste

Set translated languages in application

The default language of my app is English and I translated it into German. But now if I want to export it as an signed application in Eclipse there comes many errors that all string are not translated in other languages like es, fr , it and so on.
How can I export my app as signed application with only two languages and ignore all other languages?
You don't need to translate your app if you don't want to. Just check that all strings are defined in the base values/ folder. Then you can create more values-XX/ folders with their own strings.xml with all of the strings (or just a fraction of them). Android will take the default string if it doesn't find the localised version of the string.
If you are not localising to other languages, make sure that their values folder are not defined. For example, if you are not localising to Spanish, make sure that you don't have the values-es/ folder in your res/ folder.
EDIT: Same topic solved: Lint: How to ignore "<key> is not translated in <language>" errors?

Localization in android application

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

Categories

Resources