Skip to content

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

Open
w-rui wants to merge 1 commit into
Innim:masterfrom
w-rui:master
Open

add clearFirst for load() to clear lookups.#8
w-rui wants to merge 1 commit into
Innim:masterfrom
w-rui:master

Conversation

@w-rui

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

Copy link
Copy Markdown

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