Easy_localization: If I have support for "es" and "es-US" is asked for, fallback is used

Created on 18 Jun 2020  路  7Comments  路  Source: aissat/easy_localization

If I have support for "es" and "es-US" is asked for, fallback is used ("en") instead of "es". Event if "useOnlyLangCode: true".

easy_localization_app:_checkInitLocale doesnt check if 麓locale.countryCode麓 is empty.

bug

Most helpful comment

@EmmanuelMess Yep, same recording Locale syntax like in docs

I will fix this bug when a little free time appears, for now you can use the second variant. Thanks for issue 馃憤

All 7 comments

@EmmanuelMess iOS?

@Overman775 Android emulator and device.

@EmmanuelMess show the initialization code Easy Localiztion

Not working:

    EasyLocalization(
      supportedLocales: [Locale('en', ''), Locale('es', '')],
      path: 'lib/l10n',
      fallbackLocale: Locale('en', ''),
      useOnlyLangCode: true,
      child: DeadlinesApp(deadlineDao),
    )

Working:

    EasyLocalization(
      supportedLocales: [Locale('en'), Locale('es')],
      path: 'lib/l10n',
      fallbackLocale: Locale('en'),
      useOnlyLangCode: true,
      child: DeadlinesApp(deadlineDao),
    )

@EmmanuelMess Yep, same recording Locale syntax like in docs

I will fix this bug when a little free time appears, for now you can use the second variant. Thanks for issue 馃憤

Is it possible to map different locales to one local?
E.g. : Locale('de', 'De'), Locale('de', 'CH'), Locale('de', 'AT') which all should use the same translation file.
But for Locale('es', 'MX'), Locale('es', 'ES') I want to have them separated.

Of course I could create 3 excact json files, but this wouldn't make sense.

Is it possible to map different locales to one local?
E.g. : Locale('de', 'De'), Locale('de', 'CH'), Locale('de', 'AT') which all should use the same translation file.
But for Locale('es', 'MX'), Locale('es', 'ES') I want to have them separated.

Of course I could create 3 excact json files, but this wouldn't make sense.

Not related.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

enricoquarantini picture enricoquarantini  路  4Comments

gjrjf picture gjrjf  路  4Comments

BechirAhmed picture BechirAhmed  路  5Comments

Overman775 picture Overman775  路  6Comments

VictorCamargo picture VictorCamargo  路  6Comments