[material_ui, cupertino_ui] Localizations#12119
Open
justinmc wants to merge 322 commits into
Open
Conversation
Updating Flutter fork
…nd to make room for cupertino (#29644)
…e class with date time formatting (#29767)
…n the instructions (#30527)
…t of gen_localizations.dart (#29822)
Updating flutter fork
…nd generate one for cupertino english and french (#29824)
Updating flutter fork
…orted languages (#31644)" (#32470) This reverts commit 5c3c680.
…ted languages (#32513)
Corects a bnuch of typeos throuhgout teh Fluter codebsae. Made use of the `misspell` tool: https://github.com/client9/misspell
Moved into cupertino_ui similar to how it was done in material_ui. Both are now usable.
These were copied from the l10 folder of flutter_localizations and then modified.
In the previous iteration of this PR, this was done just by copying the code without history. I anticipate conflicts because of this when I cherry pick those commits.
794b415 to
c16ca7b
Compare
Contributor
Author
|
I'm opening this PR to review with two caveats:
01:25 +3072 ~6: /b/s/w/ir/x/w/packages/packages/material_ui/test/l10n/date_time_test.dart: ar is initialized correctly when DateFormat is used
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following TestFailure was thrown running a test:
Expected: '٨:٣٠ م'
Actual: '8:30 م'
Which: is different.
Expected: ٨:٣٠ م
Actual: 8:30 م
^
Differ at offset 001:28 +3198 ~6 -1: /b/s/w/ir/x/w/packages/packages/material_ui/test/l10n/date_picker_test.dart: CalendarDatePicker shows dates for ar_AR
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following TestFailure was thrown running a test:
Expected: exactly one matching candidate
Actual: _TextWidgetFinder:<Found 0 widgets with text "سبتمبر ٢٠١٧": []>
Which: means none were found but one was expected |
Contributor
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
justinmc
commented
Jul 8, 2026
Contributor
Author
There was a problem hiding this comment.
@stuartmorgan-g this and related scripts in this directory generate localization files for both material_ui and cupertino_ui. I avoided putting them in the root /scripts directory of this repo because I didn't want to pollute that with something that's specific to only 2 packages. What do you think is the better place for these scripts?
CC @QuncCccccc
Contributor
There was a problem hiding this comment.
If we want the script in material_ui, I think we might want it to be in material_ui/tool/ instead of material_ui/script/. See here
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR attempts to solve the flutter_localizations problem for material_ui and cupertino_ui. The crux of the problem is that apps that import flutter_localizations were getting a version of GlobalMaterialLocalizations that uses flutter/flutter's MaterialLocalizations instead of the one in material_ui (and the same thing for Cupertino). This PR moves these classes into material_ui and cupertino_ui, while keeping other localization code inside flutter_localizations.
How this PR was created
Similar to #11888, this PR copies history from flutter/flutter. All commits are preserved as-is, plus one final commit from me that is a squash of all of my work on this PR. This PR should be landed as a merge without squash.
Before
As described in flutter/flutter#188757, a typical localized app like the following would encounter runtime type errors:
After
Open Questions
I put the l10n folder in side of <material_ui or cupertino_ui>/lib/l10n because that's what the docs said. Should it be in src/?TODOs
Update l10n README files.Resources
Fixes flutter/flutter#188757