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
Related
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?
I have an android application on eclipse it's text-views and the buttons' texts on Arabic language , I want to localize my application to both Arabic and English users .
Firstly under res folder I have created another folder and named it values-en .
I let the original folder values as is it and later I will use it for Arabic .
My first question it is necessary to create another folder (values-ar) for Arabic localization issues.
Or original values folder is just enough?.
Secondly
On values-en folder I created strings.xml file and added the following statement to it
COMTAS
I set the text of one of the textviews from resource chooser so choose application-title .
after that the textview's text converted to #string/application-title.
the project gives me the following message
NOTE: This project contains Java compilation errors, which can cause rendering failures for custom views. Fix compilation problems first.
Can someone explains to me how to make localization in simple steps.
And how I can retrieve textviews' texts either in english or arabic (reading from values folder)?
First: Leaving a strings.xml in the "values" folder will cause this language to be "default" (or rather "fallback") language.
Second: The text is read automatically from the strings.xml placed in the values-folder matching your System Locale (the locale you get when you call Locale.getDefault()), e.g. if system locale is set to english, the values are taken from values-en folder. Therefore it would be wise to place the arabic values in a values-ar folder.
I can't say anything related to your compile errors as you didn't post the code causing the error.
It's always good to follow the documentation. Here is the link for Localizing with Resources.
Create a values-ar folder for the arabic language, and let the default language as english. Why?
Whenever the application runs in a locale for which you have not provided locale-specific text, Android will load the default strings from res/values/strings.xml.
So if your application is running on a device set to Spanish language, it would still load arabic language (if it's set as default).
English is a most talked language, which would be better to let english by default, ant let the arabic language in values-ar(in my humble opinion).
Hope this helps you.
I just got my app strings translated to italian but having issues in displaying them on android device.
For example, one of the word is "velocità", on the device the last character à is shown as junk character.
Any pointers on how can I resolve it. The above word is present in the raw-it folder in a .txt file.
I assume you have the txt file not encoded as utf-8. Right click on the file in Eclipse and then properties. Set it to UTF-8. (You might need to copy the text into it again to make the characters appear ok).
UTF8 encoding supports foreign language characters. Try using UTF8 encoding. if that doesnt work then the problemmight be because of the font used.Good Luck.
I am trying to display text in Indian regional languages on an Android app.
I've set up all the localization folders even though, I just want to have only one language for my app (say Punjabi).
In my strings.xml I have tried putting Hindi characters and Chinese characters and these are displayed correctly on the emulator. But when I put in Punjabi characters nothing shows up on the emulator.
Any reason for this? Can I overcome this problem?
I have the option of using a .ttf file in the assets folder for punjabi font. But that is not what I want to do because it does not give me complete control over the contents being displayed. Each .ttf behaves differently.
Any help is truly appreciated.
There is no support for local Indian languages on Android as yet. Hence the UTF-8 characters that fall outside the acceptable range for Android are ignored. Hence we see a blank being displayed.
My default app language is English so strings.xml is located under res\values.
My app should also support Hebrew, so I put a Hebrew copy of strings.xml under res\values-he.
My problem is that on some devices, Hebrew is defined as "iw" (instead of "he").
Is there a way to save me the trouble of another copy of strings.xml under res\values-iw, but to have one folder to handle he,iw and use the default values folder for all the rest?
It's a known issue and already answered here:
CyanogenMod: Translate a Project
So if you want full support on all devices, you have to include both versions.
It's just copy & paste, where's the trouble? :)