localization icon indicating copy to clipboard operation
localization copied to clipboard

Resouce load is not syn with setlocal

Open joyhope opened this issue 2 years ago • 0 comments

As the demo,

changeLocale(Locale locale) { setState(() { _locale = locale; }); }

The widget application will switch the localization display.

but Text("xxx".i18n()), the i18n resource load may failure because

Future changeLanguage(Locale locale, List<String> directories) async { clearSentences(); for (var directory in directories) { await _changeLanguage(locale, directory); } }

This is asyn, the clearSentences() will execture, but the resource has not loaded.

But the String read(String key, List<String> arguments) { if (!_sentences.containsKey(key)) { return key; <<== the problem here. }

Am i right?

joyhope avatar Jul 17 '23 06:07 joyhope