Open bilalsammour opened 1 year ago
Related to https://github.com/dart-lang/i18n/issues/197.
it is safe to use Arabic numbers (0123456789) for all.
I disagree (at least for locales other than ar
). If the device's locale uses eastern numerals (e.g. ar_SA
and ar_EG
), it wouldn't be great to use western numerals in a Flutter app. The choice of numerals should instead depend on the locale; for instance, ar_DZ
uses western numerals, while ar_SA
uses eastern ones. I wouldn't mind opening a PR for this, as this is something that I'm hitting myself now.
@mhmdanas
I agree, but using Eastern and Western numerals in the same locale does not make sense. Try to show numbers and a formatted date using ar_SA
for instance, you will see Eastern and Western numerals together!
Yes, my objection was mainly against the idea of using western numerals for ALL Arabic locales. Mixing them in the same locale is definitely even worse though.
Note: I found out that you can work around this by running DateFormat.useNativeDigitsByDefaultFor('ar', false);
before creating any DateFormat
's.
The workaround fixed it for the numbers, but what about the months names, in ar_TN and ar_EG for exemple, the months names are different, but I am getting the same name for all arab locales, and it is ignoring the country code, any idea how to fix that?
That's an entirely separate issue; it would require adding these locales as I request in this ticket.
I see, thanks for your quick response, any chances we get these locales supported in the near future?
I have no idea, I'm just a random user with no affiliation to this repository. :)
Describe the bug In Arabic locale
ar
, it shows the Indian numbers (٠١٢٣٤٥٦٧٨٩
) for any DateTime format, such asyMd
, however, it shows the Arabic numbers (0123456789
) when formattingint
ordouble
such asdecimalPattern
.To Reproduce Use the following
app_ar.arb
and set the phone language to Arabic, OR just set the default locale to Arabic:Expected Use either Arabic or Indian numbers, but not both, to choose between Arabic or Indian numerals, follow the phone system, or it is safe to use Arabic numbers (
0123456789
) for all.System info < Dart SDK 2.19.3 Flutter SDK 3.7.6 intl_demo 1.0.0+1
dependencies:
dev dependencies:
transitive dependencies: