Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use arabic letters with arabic numbers

It might sounds weird, but the fact is that Android handles languages really bad. Take Arabic for example :

Arabs in the east-part use arabic letters (ابجدهوز) and persian numbers (٠١٢٣٤٥٦٧٨٩).

Arabs in west-part use arabic letters (ابجدهوز) and arabic numbers (0123456789).

Android only have one kind of Arabic which is the first.

I'm looking for a way to apply the second kind in my application (use arabic letters but also arabic numbers)

Is there any way to do so?

like image 201
Souhaib Guitouni Avatar asked Sep 28 '22 07:09

Souhaib Guitouni


1 Answers

Try to specify the numbering system (nu) in the default locale. For example, the following locale would make the system displaying Indian numbers (٠١٢٣٤٥٦٧٨٩)

Locale AR_LOCALE_EAST_NUMBERS = new Locale.Builder().setLanguageTag("ar-u-nu-arab").build();
Locale.setDefault(AR_LOCALE_EAST_NUMBERS);

  • See Setting Arabic numbering system locale doesn't show Arabic numbers.
like image 87
Eng.Fouad Avatar answered Oct 03 '22 00:10

Eng.Fouad