Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Updates to generating localized messages #1796

Merged
merged 5 commits into from
Feb 21, 2025

Conversation

AdamVe
Copy link
Member

@AdamVe AdamVe commented Feb 20, 2025

The use of synthetic package is deprecated and will be removed, see this breaking change description. Instead apps should generate the localized messages into source and PR fixes this.

These changes will not affect the way how we work with localizations. When we need to add a new string, let's just put it into app_en.arb and build the app to be able to use it in code.

Changes:

  1. Updated l10n.yaml with options to not use the synthetic package an pointed out where the new sources should be generated.
  2. Updated all sources to include correct app_localizations.dart file.
  3. the generated folder is ignored in git and will be always created during build, but for making sure that nothing is broken, the pre-commit hook is updated so that it always regenerates the localized messages sources.
  4. AppLocalization.of(context) now returns no-nullable getter.
  5. Updated license header years and added missing license headers.

This has been tested on desktop and Android on both Flutter 3.27.4 and 3.29.0 versions.

@AdamVe AdamVe merged commit dee32fa into main Feb 21, 2025
10 checks passed
@AdamVe AdamVe deleted the adamve/l10n_without_synthetic_package branch February 21, 2025 13:23
@AdamVe AdamVe mentioned this pull request Feb 24, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants