Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resouce load is not syn with setlocal #9

Open
joyhope opened this issue Jul 17, 2023 · 0 comments
Open

Resouce load is not syn with setlocal #9

joyhope opened this issue Jul 17, 2023 · 0 comments

Comments

@joyhope
Copy link

joyhope commented Jul 17, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant