When I am trying to use brackets in Arabic language, they are getting reversed as shown in the attached .
I have tried using textDirection RTL and BidiFormatter, but none of them works.
The correct string is something like this "(باقة مسافر إسبوعي (مسبق".
Does anyone know, how to solve it?
Asked
Active
Viewed 2,475 times
9

Chetna
- 864
- 8
- 26
-
wheres the screenshot?? – Illegal Argument Jun 25 '14 at 10:07
-
Sorry i do not see that something is reversed. Please post a picture how you want it instead too. – greenapps Jun 25 '14 at 17:49
-
@greenapps: I have edited my question for the correct string :) – Chetna Jun 26 '14 at 07:45
2 Answers
4
I have found it. The solution is below:
String targetString = "\u200E"+originalString

Melebius
- 6,183
- 4
- 39
- 52

hong chainan
- 103
- 1
- 5
-
@Melebius this worked perfectly for me. Took whole day to get here. I had the same problem that the brackets/parentheses were misplaced in urdu/hindi/arabic localisation. After putting (\u200E) got the right string with properly placed parentheses. P.S - I am trying to include all the keywords so that one might find it easily. – Momin Khan Oct 29 '19 at 15:03
-
@MominKhan The credit should go to [hong chainan](https://stackoverflow.com/users/4268248/hong-chainan). I’ve just edited a minor grammar problem here and don’t know much about the topic… – Melebius Oct 29 '19 at 16:21
-
0
Check this solution its works
Copy this lines and paste it in strings.xml file in res\values
for English
<string name="email_optional">Email (optional)</string>
For Arabic
<string name="email_optional">)اختياري(إيميل </string>

Mahmoud Dahdouh
- 19
- 2