9

When I am trying to use brackets in Arabic language, they are getting reversed as shown in the attached Screenshot.
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?

Chetna
  • 864
  • 8
  • 26

2 Answers2

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
  • not working with flutter, is there any way for flutter? – Diificult Ranger May 26 '23 at 12:14
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">&#41;اختياري&#40;إيميل </string>