-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Support preferred locales for gen_l10n #47845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
'By default, the tool will generate the supported locales list in ' | ||
'alphabetical order. Use this flag if you would like to default to ' | ||
'a different locale. \n\n' | ||
'For example, pass in [\'en_US\'] of you would like your app to ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...if you would like...
dev/tools/localization/gen_l10n.dart
Outdated
|
||
if (preferredSupportedLocales != null) { | ||
for (LocaleInfo preferredLocale in preferredSupportedLocales) { | ||
if (!localeInfoList.contains(preferredLocale)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally prefer adding the parentheses for all control statements, but I don't think we require that for flutter/flutter right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's right. I actually prefer adding the parentheses for control statements as well because I feel that it doesn't cause as much confusion, but got used to doing it both ways. I added it back in for this particular case
…d list stays in alphabetical order
Description
Currently, the gen_l10n tool sorts supported locales by alphabetical order by default. This change adds the ability to add locales to the start of the list if a developer wants to prefer particular default locales over others.
Related Issues
Fixes #46244
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.///
).flutter analyze --flutter-repo
) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.