Open joyhope opened 1 year ago
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. }
String read(String key, List<String> arguments) { if (!_sentences.containsKey(key)) { return key; <<== the problem here. }
Am i right?
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?