slang-i18n / slang

Type-safe i18n for Dart and Flutter
https://pub.dev/packages/slang
MIT License
474 stars 39 forks source link

baseLocale selected over language matches when there is no country code match #241

Closed manuramosdev closed 2 months ago

manuramosdev commented 2 months ago

I have seen this in the iOS simulator.

Inspecting the code, I see that:

  1. There is no exact match
  2. There is more than one candidate that matches the langaugeCode
  3. There is a non-null countryCode to match
  4. No candidate matches the countryCode
  5. baseLocale is returned at singleton.dart:109 (in my case, "es")

Is this expected behavior? Should the first candidate of the same language take precedence over the baseLocale? Should I report that "fr_ES" weird thing to the Flutter team?

Thanks for your work.

Tienisto commented 2 months ago

Thank you. This is indeed a bug. Fixed in v3.31.2