This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Initialize locale from FlutterEngine#17473
Merged
dnfield merged 4 commits intoflutter:masterfrom Apr 2, 2020
Merged
Conversation
7 tasks
chinmaygarde
approved these changes
Apr 2, 2020
| [_engine.get() platformViewsController] -> SetFlutterView(_flutterView.get()); | ||
| [_engine.get() platformViewsController] -> SetFlutterViewController(self); | ||
| [_engine.get() platformView] -> NotifyCreated(); | ||
| [_engine.get() platformViewsController]->SetFlutterView(_flutterView.get()); |
Contributor
There was a problem hiding this comment.
Is this stuff because the newest toolchain brought a new clang-format along with it? If possible, can you submit this without this bit. Lets format the repo again so PRs are not polluted with these changes.
Contributor
Author
There was a problem hiding this comment.
I believe so. Without this, the format ci job fails.
Member
There was a problem hiding this comment.
My formatter always clobbered these, nice to have CI in alignment with my tools.
Contributor
Author
There was a problem hiding this comment.
I have to pull these out again because the toolchain roll got reverted. When I land it again, I'll land a full reformat with or after it.
gaaclarke
approved these changes
Apr 2, 2020
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 2, 2020
goderbauer
pushed a commit
to goderbauer/engine
that referenced
this pull request
Apr 16, 2020
* Initialize locale from FlutterEngine
This was referenced Apr 28, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Right now, FlutterViewController listens for updates to the system locale and initializes
dart:ui#window.localeatviewDidAppear. This is too late for callers who want to know the locale inmain(or, when they're trying to set up localization for aWidgetsAppor derivative).This patch makes
FlutterEngineresponsible for setting the Locale and listening for changes, and makes sure that happens earlier in the initialization cycle.Adding the assertion to
main.dartof the Scenarios app makes tests fail if the locale is not set up, with a log like this:Fixes flutter/flutter#39032