Android Translating To Arabic
I am working with an Arabic translator who is translating my strings.xml from english to arabic. I realize that only Honeycomb or Cyanogen roms will support arabic rendering, but that is ok.
Our problem is that the text keeps getting flipped around. It seems that some text editors (like Eclipse) blatantly do not support right-to-left text. And in some cases, the text is not flipped character by character, but word by word, or parts of the sentence get rearranged ... when copying from Microsoft Word back into the UTF-8 xml file.
For example, the translator supplied lines with spaces on each end, and naturally I wanted to clean these up. But doing so flipped some of the text around!
F开发者_StackOverflow社区or example:
إغلاق التطبيق became: التطبيقإغلاق just by removing spaces around the edges.Questions:
1. What editor should I be using? 2. Is it ok to mix english and Arabic on the same line (such as the App Name or other words that should not be translated) or is this fundamentally a no-no?I am currently working on an Arabic/English project, and I speek both languages, so I can provide you with my experience :)
Answer to Question 1: Any editor that supports UTF8 will do. I am now using both eclipse and notepad++.
To setup eclipse with UTF8 (which is not the default for some reason), go to window menu -> preferences -> general -> workspace then change text file encoding from deault (cp1252) to other, and choose utf8, then restart eclipse.
For notepad++, ensure you install supported locales, including Arabic. It is not checked during instulation and you have to tick the checkbox to enable that feature.
Answer to Question 2: It is absolutely fine to mix Arabic and English words together in a sentence. A very very good article I found about that is written here http://www.w3.org/International/tutorials/bidi-xhtml/
This article describes design concepts for sites that support right-to-left languages (including Arabic and Hebrew), with emphasis on Arabic due to it being a more complex language because some letters get connected to others and some do not.
Even though this article is talking about website design, it has a good amount of how Arabic and English languages should be mixed.
There a simple way to insert the right to left and left to right marks in any application under windows:
1- Right to left mark: ALT + 0254 from the right numeric pad in the keyboard 2- Left to Right mark: ALT + 0253 from the right numeric pad in the keyboard
Withouusing any special editors or macros, this can be used in any application, whether in Notepad, Word, HTML, XML... etc.
Hopefully, this would be helpful for everybody
Best regards Your Arabic Translation Team
1- I developed few Android apps that support Arabic and I am using Notepad++ to edit the resources file without any problems. Just remember to select RTL from view menu (Ctrl+Alt+R).
Virtually all Android devices that support Unicode will display Arabic letters, but if bidi algorithm is not part of specific Android version you can use a custom library to connect letters and display Arabic correctly.
Here is a library that I used before
A Blog that describes how to use it
2- In general, I would not recommend mixing Arabic and English especially if it will involve special characters as it can be displayed awkwardly.
I know the Eclipse part, the default font in Eclipse doesnt support Unicode, So change it to "Aria Unicode MS" font. To do this in Eclipse workspace click on Windows in Menu Bar -> Preferences -> General -> Appearance -> Colors and Fonts. Now in the file explorer like menu in right, expand Basic, select "Text Font" and click on Edit.. button.
Hope this solves your viewing issue with Eclipse.
About Arabic app name issue, think on this, if you do localization correctly, then the Arabic name for app will be displayed only when the user changes the handset locale (and thus language) to Arabic, otherwise the default English app name will be displayed. So, just set the Arabic name in Arabic string.xml and English in the English one and you should be good.
As for editor part, there is no way to answer your question without knowing the platform. On Windows, standard Notepad should do.
For mixing strings, it is rather common scenario. It is typical that App Name won't get translated. Also, sometimes you need to put some English description in the brackets. You might need to play with strong directionality marks in such case (otherwise brackets would look a bit strange).
精彩评论