Skip to content

Conversation

goderbauer
Copy link
Member

Prior to this change we were telling people to modify the global Intl.defaultLocale when their custom Localizations for a new locale are loaded. That's a bad idea because Flutter allows that different parts of the same app use different localizations. For example, let's say your global locale is de. Now you have one screen in the app that uses a locale of en via the Localizations.override widget. When the first locale is loaded, Intl.defaultLocale is set to de and everything in your app appears in German as expected. When you navigate to the screen that has the Localizations.override, the en local is loaded and Intl.defaultLocale is set to en forcing the entire (!) app to English, even the parts outside of the Localizations.override.

This change no longer recommends the usage of Intl.defaultLocale and instead holds on to the locale applicable to the current Localizations instance in an instance variable.

Fixes flutter/flutter#40353.

@googlebot googlebot added the cla: yes Contributor has signed the Contributor License Agreement label Sep 18, 2019
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

'Hello World',
name: 'title',
desc: 'Title for the Demo application',
locale: localeName,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Contributor has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LicensePage widget forces iOS phone language to English
3 participants