9

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

Michał Ziobro
  • 7,390
  • 6
  • 50
  • 99

4 Answers4

7

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

similar type answered here

Community
  • 1
  • 1
Fahim
  • 11,496
  • 4
  • 36
  • 56
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.

bigOther
  • 9,792
  • 5
  • 45
  • 87
  • seems to be right but I will be checking further whether some order of words didn't changed – Michał Ziobro Mar 16 '15 at 11:47
  • for the changing of variable places in translations, I think this is the job of the translator. Each language has its structure. – bigOther Mar 16 '15 at 14:26
  • 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 :) – Michał Ziobro Mar 16 '15 at 14:42
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

Akram Hassan
  • 191
  • 9
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);
hrskrs
  • 4,301
  • 5
  • 36
  • 52