Hi!
I got problem in 2.0.0+1, locale alwais return 'en'
When i delete fallbackLocale bug gone...
Intl.defaultLocale =
ui.window.locale.languageCode + '_' + ui.window.locale.countryCode;
runApp(EasyLocalization(
child: MyApp(),
supportedLocales: [
const Locale('ru'),
const Locale('de'),
const Locale('en'),
const Locale('es'),
const Locale('it'),
const Locale('pl')
],
path: 'assets/langs',
useOnlyLangCode: true,
fallbackLocale: Locale('en'),
));
}
print(Intl.defaultLocale); /// ru_RU
print(EasyLocalization.of(context).locale.toString()); /// en
P.S.: i clean every time SharedPreferences for reset saved local
@Overman775 fallbackLocale to specify the starting locale of app #65
plz if possible explain more wat u want exactly
maybe this Duplicate of #85
I try get device locale (ui.window.locale.languageCode) and set as default.
But if language not suportet then get 'En' locale.
Maybe duplicate #85, but i don't see code 馃槂
@Overman775 u can get Device locale by Intl.systemLocale #83
systemLocale is always return en_EN if you don't run findSystemLocale(), i use ui.window.locale to get device locale and set manualy, its work fine.
I think the problem is in the concept of fallbackLocale
fallbackLocale != starting locale, its wrong... fallbackLocale should set which language to use when there is no locale in supportedLocales.
@Overman775 u can get Device locale by
Intl.systemLocale#83
@Overman775 is right about this. Unfortunately Intl.systemLocale which you recommend to me returns 'en_EN'. Need to use "ui.window.locale". I expect you to add this feature to the package.
Most helpful comment
systemLocale is always return en_EN if you don't run findSystemLocale(), i use ui.window.locale to get device locale and set manualy, its work fine.
I think the problem is in the concept of fallbackLocale
fallbackLocale != starting locale, its wrong... fallbackLocale should set which language to use when there is no locale in supportedLocales.