Repository navigation
[gen_l10n] Preserve script locale inheritance for regional subclasses - #190956
Merged
auto-submit[bot] merged 1 commit intoAug 19, 2026
Merged
auto-submit[bot] merged 1 commit into
auto-submit[bot] merged 1 commit into
Conversation
Boulea7
marked this pull request as ready for review
August 12, 2026 19:40
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the localization generator in gen_l10n.dart to correctly resolve parent locales for script and country combinations, ensuring that regional subclasses inherit from their script-specific parent locales rather than defaulting directly to the base language locale. It also updates the unimplemented message detection to check the entire inheritance chain and introduces a private _withLocale constructor to preserve public constructors. Corresponding unit tests have been added to verify these inheritance hierarchies. There are no review comments, so I have no feedback to provide.
bkonyi
approved these changes
Aug 18, 2026
bkonyi
left a comment
Contributor
There was a problem hiding this comment.
LGTM! We just need one more review before this can land.
chingjun
approved these changes
Aug 18, 2026
Change-Id: I2479a0159543569cfd2943a076f1c1156b840d76
chingjun
force-pushed
the
fix-gen-l10n-locale-hierarchy-187948
branch
from
August 18, 2026 19:22
90fdddf to
6086634
Compare
This was referenced Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a locale contains language, script, and country subtags, generate its localization subclass from the matching script-only locale when that locale exists. If it does not exist, retain the existing language-level fallback.
The generated script class keeps its public zero-argument constructor and adds a private forwarding constructor for regional subclasses so the full locale name is preserved. Untranslated-message reporting now follows the same inheritance chain.
Fixes #187948.
Tests
dart test test/general.shard/generate_localizations_test.dart --name 'uses a script locale as the parent for a regional locale|selects parent locales for script and country combinations'dart test test/general.shard/generate_localizations_test.dart test/general.shard/build_system/targets/localizations_test.dart test/commands.shard/hermetic/generate_localizations_test.dartdart test test/integration.shard/gen_l10n_test.dart --concurrency=1dart analyze --fatal-infos lib/src/localizations/gen_l10n.dart test/general.shard/generate_localizations_test.dartflutter analyze lib/src/localizations/gen_l10n.dart test/general.shard/generate_localizations_test.dartdart format --output=none --set-exit-if-changed lib/src/localizations/gen_l10n.dart test/general.shard/generate_localizations_test.dartAI assistance disclosure
Codex assisted with implementation, tests, and verification.
Pre-launch Checklist
///).If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.