How to edit arabic string correctly?
<string name="message">هذا المجلد يحتويى على %1$s ملفات. الرجاء التأكد قبل الحذف. الملفات المحذوفة غير قابلة للإسترجاع.</string> I want to put "% 1 $ s" in an Arabic string, but as you can see here, the word, notepad ++, utraedit, all could not get the correct string. how do you guys edit arabic string?
In android Studio 2, RTL support is not enabled by default, configure it manually:
1. On your computer, go to [android-studio2.0]/bins/idea.properties
2. add editor.new.rendering=true at the end of idea.properties
3. restart android studio .
This is a source of frustration when editing blended text. What is considered the logical order of the text, and not how any editor displays it. When you finally format the string at runtime, %1$s will be replaced with any string passed to the formatting method. The only thing that matters is how the string will be displayed after substitution.
The easiest way is to record a message without %1$s , then place the insert, insert the format code and simply ignore how the editors twist the bidi analysis. (The correction is due to the fact that the editors use the left-right base level. In some editors, you can set the base stream left and right, but then the xml markup ends up unreadable.)
You can try in Activity ..
String formatedString = String.format("%1$s", getString(R.string.your_string)); When I work with RTL text and I need to put a place ( %1$s ) or LTR words, I just write it in MS Word and copy it to the IDE.
This works for me in Eclipse and Android Studio.
All you need to check is that the components displaying this line, like TextView , have the correct density.