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

add clearFirst for load() to clear lookups. #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

w-rui
Copy link

@w-rui w-rui commented Aug 14, 2021

The load sequence of l10n delegates may not same with the sequence in MaterialApp(localizationsDelegates: [...]).
eg:
delegateA support en, ko, zh.
delegateB support en, ko.

MaterialApp(localizationsDelegates: [
  multiDelegate,

  delegateB,
  delegateA,
  ...,
]);

The code above works ok when locale is en/ko. BUT, when locale changes from zh => ko, delegateA overrides delegateB.
delegateA has been added to _lookups when locale is zh, and will not go behind of delegateB when locale changed to ko and add delegateB.

'clearFirst' will clear _lookups when locale changes and fix the problem.

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

Successfully merging this pull request may close these issues.

1 participant