Skip to content

Canonicalize locale string in gen_l10n.dart#44758

Merged
shihaohong merged 4 commits intoflutter:masterfrom
shihaohong:canonicalize-locale-string
Nov 13, 2019
Merged

Canonicalize locale string in gen_l10n.dart#44758
shihaohong merged 4 commits intoflutter:masterfrom
shihaohong:canonicalize-locale-string

Conversation

@shihaohong
Copy link
Contributor

Description

Canonicalize locale string in gen_l10n.dart script to help try and correct the locale value if possible.

@shihaohong shihaohong added the a: internationalization Supporting other languages or locales. (aka i18n) label Nov 12, 2019
@fluttergithubbot fluttergithubbot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Nov 12, 2019
@fluttergithubbot
Copy link
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

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

We should sort supportedLanguageCodes too.

Also: this PR's description should mention the sorting.

];

for(String pluralKey in pluralIds.keys) {
for (String pluralKey in pluralIds.keys.toList()..sort()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to sort pluralIds (which should be const instead of final). It's a LinkedHashMap so the order of the keys is stable and matches the order they were defined in.

@shihaohong
Copy link
Contributor Author

I mistakenly added some extra code from a separate branch into this PR. I just removed those lines.

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

@shihaohong shihaohong merged commit a872a70 into flutter:master Nov 13, 2019
@shihaohong shihaohong deleted the canonicalize-locale-string branch January 8, 2020 05:00
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: internationalization Supporting other languages or locales. (aka i18n) c: contributor-productivity Team-specific productivity, code health, technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants