Use Synthetic Packages for localizations#282
Use Synthetic Packages for localizations#282shihaohong merged 6 commits intoflutter:masterfrom shihaohong:synthetic-l10n
Conversation
rami-a
left a comment
There was a problem hiding this comment.
LGTM, look at all those deleted lines!
|
The tests are failing because the However, since |
| @@ -44,7 +44,6 @@ Future<void> generateLocalizations() async { | |||
| '--preferred-supported-locales=["en"]', | |||
| '--use-deferred-loading', | |||
There was a problem hiding this comment.
Are these arguments still needed now with the l10n.yaml file? Or is it simply enough to just run gen_l10n.dart?
There was a problem hiding this comment.
The command itself shouldn't be necessary at all anymore, since localizations generation is baked into Flutter run, restart, reload, pub get, analyze and test.
The only reason I've left it in for now is because there's an issue with the gen_l10n tool's having the incorrect dependencies when switching between flutter versions that I still need to fix. Running the grinder command will always work, whereas the synthetic package generation may fail unless flutter update-packages is run.
|
I am having some trouble running the Gallery from the latest commit.
and after running |
|
|
|
Is flutter gallery expected to run on flutter stable too? I'm getting if I run on stable. |
|
Nope, gallery targets master https://github.com/flutter/gallery#running-flutter-gallery-on-flutters-master-channel so its expected that things won't always work on stable. |
|
Understood, thanks for clarifying. |
|
I've been getting this LUCI test issue when I sync flutter/flutter past this commit. Do we need to modify dev/bots/test.dart to unblock flutter/flutter? |
|
@627171314 please follow the steps at #282 (comment), if that doesn't work, please file a separate issue. |


With synthetic package support in the gen_l10n tool (flutter/flutter#62395), we no longer need to check in generated localizations .dart files into any Flutter project. Here is the laundry list of changes involved in the PR:
l10n.yamlfile to set up localizations generation whenflutter test,flutter pub get,flutter analyzeare invoked. It also generates localizations onflutter run, hot reload and hot restart so that direct modifications to the arb files can be made and observed while in development..dartlocalizations files from source control, since it's no longer needed.grind.darttool that formats the generated code. I left the rest of thegrind.dartcommand in there because it seems like we runningflutter pub getin${FLUTTER}/dev/toolsis unfortunately still a necessity. My hope is to get rid of this requirement altogether, but I plan on doing this in a subsequent PR.flutter update-packagesas a step in the CI temporarily since without it (issue filed [gen_l10n] pub get required in dev/tools when switching between flutter versions flutter#65023),flutter pub getdoes not work as expected since the gen_l10n tool's dependencies are not always in sync. This is particularly observed when switching between versions of flutter (ie. upgrading from stable to master branch, or vice versa)