Arabic numerals with ar-ae and ar-sa locale on Android

As I asked on the following question:

Arabic number in Arabic text on Android

if i use arabic local arch or ar-sa, the numbers are displayed using hindu-arabic numbers. I need to show the numbers, as in English: "1234567890".

I used a trick to install an extension with a number

Locale.Builder builder = new Locale.Builder();
builder.setLocale(savedLocale).setExtension(Locale.UNICODE_LOCALE_EXTENSION, "nu-latn");
Locale locale = builder.build();

The problem is that after you do this, the resource search will break, and with Nougat it will no longer work.

Is there a way to see "normal" numbers, even using Arabic for ae and sa?

+4
source share
3 answers

. .

, TypeFaceSpan. question.

- , , .

+2

char "-" .

, ?

+1

You must trust the language you use. If you specifically target ar_SA, then you should let it display things as it was for this country. If you just want Arabic, but want Western Arabic numbers, try a locale from one of the Western Arabic countries, for example, ar_MA.

+1
source

Source: https://habr.com/ru/post/1667253/


All Articles