10

Hello I have a question about arabic formatting how should I properly format this strings, it seems i can't manage this:

تحميل %1$s…

تم تحميل الكلمات. %1$d/%2$d!

This is in sublime text 2 - but i think that there is Left-to-Right order

enter image description here

EDITED: In Eclipse this copied from Sublime Text gets messed up a little. I hire some person to translate from english to arabic strings.xml. He used Word editor but things get messed up when coping to eclipse and I suggested to changed it in Sublime Text, that I think will support it correctly like in Eclipse and is lighter editor. I see that in Sublime Text seems to be in Left-To-Right order which is also wrong. * When I run app with this messed up special characters it seems to run correctly. Bu I have doubt whether some interpunction words hasn't also messed up and for example: Item 5/10 has been downloaded. will be Item has been downloaded. 5/10 or something like this.* Need a preferred way to get someone english written strings.xml, get this translated, and then copied into /values-ar and working correctly? enter image description here

1
  • why are you using sublime text ? how does the file look in eclipse/android studio Commented Mar 16, 2015 at 7:43

4 Answers 4

9

Try adding a RIGHT-TO-LEFT MARK character (\u200F) at the start of your text.

similar type answered here

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! I used to have a lot of problems with Arabic texts starting with a word in English. (The app in which I work needs this in some moments). This works like a charm.
3

That is a sublime issue with Right-to-Left languages as listed here. You dont have to worry too much about it because it does not affect the results, your app will show it perfectly.

3 Comments

seems to be right but I will be checking further whether some order of words didn't changed
for the changing of variable places in translations, I think this is the job of the translator. Each language has its structure.
yes this is the job of the translator but sending it in some document via internet, copying between several editors and it has 3 different structure of the sentence, for me this arabic chars are meaning nothing :)
3

"To solve this problem, use the unicodeWrap() method, found in the BidiFormatter class, on every piece of text that you insert into a localized message."

Quoted from here https://developer.android.com/training/basics/supporting-devices/languages.html#FormatText

Comments

1

You have to use Arabic Font like:

Typeface face = Typeface.createFromAsset(this.getAssets(), "fonts/arabic_letters.TTF");
yourTextView = (TextView) findViewById(R.id.yourTextVIew);
yourTextView.setTypeface(face, Typeface.BOLD);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.