Skip to content

Sort Localization generation output#44743

Merged
shihaohong merged 3 commits intoflutter:masterfrom
shihaohong:sort-generated-localizations
Nov 12, 2019
Merged

Sort Localization generation output#44743
shihaohong merged 3 commits intoflutter:masterfrom
shihaohong:sort-generated-localizations

Conversation

@shihaohong
Copy link
Contributor

Description

  • When creating locales that were assumed from existing locales, the
    file that is used is non-deterministic. This adds a sort to the iterator
    to ensure that the same existing locale is used to generate the assumed
    locale
  • When generating material, cupertino and date localizations, the generated getters were not sorted. This introduces an alphabetic sort

Related Issues

Fixes #44728

Tests

I added the following tests:

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

- When creating locales that were assumed from existing locales, the
file that is used is non-deterministic. This adds a sort to the iterator
to ensure that the same existing locale is used to generate the assumed
locale
- When generating material, cupertino and date localizations, the generated getters were not sorted. This
introduces an alphabetic sort
@shihaohong shihaohong added f: material design flutter/packages/flutter/material repository. a: internationalization Supporting other languages or locales. (aka i18n) f: cupertino flutter/packages/flutter/cupertino repository labels 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

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

Why did you add dev/snippets/lib/main.dart.snapshot? I don't think that should be checked in.

@shihaohong
Copy link
Contributor Author

That was a mistake (and not sure where that came from). I just removed it

@shihaohong
Copy link
Contributor Author

Landing on red to fix the tree!

@shihaohong shihaohong merged commit 2b49856 into flutter:master Nov 12, 2019
@shihaohong shihaohong deleted the sort-generated-localizations branch November 12, 2019 20:50
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 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. f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gen_localizations.dart: inexplicable diffs, no intl package license headers found

4 participants