Repository navigation
Conversation
… and exclude root fallback in JSON Per UTS unicode-org#35 Part 4 Step 1, intervalFormatItem entries do not inherit from root for non-root locales. Previously: - GenerateProductionData stripped explicitly vetted ↑↑↑ (INHERITANCE_MARKER) intervalFormatItem entries whose Bailey value came from root, making them indistinguishable from absent (unvetted) paths in production XML and ICU. - Ldml2JsonConverter (resolved mode) inherited absent intervalFormatItem entries from root into non-root CLDR JSON bundles. Changes: - GenerateProductionData: materialize explicit ↑↑↑ intervalFormatItem entries whose Bailey value comes from root (preserving original non-distinguishing attributes such as draft), with parent-locale and lateral-calendar-alias deduplication, draft-precedence checks, and descendant anti-shadowing. - LdmlConvertRules / Ldml2JsonConverter / VerifyJson: exclude root-sourced intervalFormatItem paths for non-root locales in resolved mode using getSourceLocaleIdExtended(path, null, false) so resolved JSON matches what vetters approved and is identical on raw and production XML. - Add unit tests in GenerateProductionDataTest and Ldml2JsonConverterTest. Co-authored-by: Gemini <176961590+gemini-code-assist[bot]@users.noreply.github.com>
4 of 7 tasks
This branch has not been deployed
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.
CLDR-19944
Note
Draft PR — Option 1 Prototype Pending TC Decision on CLDR-19944
This Draft PR implements Option 1 on CLDR-19944 (enforcing UTS #35 Part 4 Step 1 across
GenerateProductionData,Ldml2JsonConverter, and ICU). Because Survey Tool,GenerateProductionData,cldr-json, ICU4C, ICU4J, and ICU4X all currently inheritintervalFormatItemfromroot(and no implementation has enforced Step 1 since 2016), CLDR-19944 also puts forward Option 2 for TC consideration: updating UTS #35 to match what every implementation already does instead of changing CLDR, ICU4C, ICU4J, and CLDR JSON (along with Survey Tool /CheckDatesdata-quality improvements applicable under either option).Summary
Implements CLDR-19944 so that both
GenerateProductionData(production XML, consumed by ICU) andLdml2JsonConverter(resolved CLDR JSON, consumed directly by ICU4X) match UTS #35 Part 4 Step 1 (intervalFormatItemdoes not inherit fromrootfor non-root locales) and preserve what vetters explicitly approved via↑↑↑in the Survey Tool:GenerateProductionData.java:↑↑↑(INHERITANCE_MARKER)intervalFormatItementries whose Bailey value comes fromroot(whenADD_ROOTis enabled), preserving original non-distinguishing attributes such asdraft(sodraft="unconfirmed"/draft="provisional"entries continue to be filtered appropriately downstream).↑↑↑and missing data.es_419→es) and lateral calendar aliases (e.g.,buddhist→generic,islamic-civil→islamic→generic), respecting draft precedence, coverage inclusion, andaltattributes, and emits descendant anti-shadowing overrides when an ancestor's materialized aliased path would otherwise shadow a child's override on the alias target.FILE_MATCHandskippedPreBasicLocalesat the start ofmain(...)so repeated in-JVM invocations do not leak static state.LdmlConvertRules.java,Ldml2JsonConverter.java, andVerifyJson.java:root-sourcedintervalFormatItempaths for non-root locales in resolved mode viagetSourceLocaleIdExtended(path, null, /*skipInheritanceMarker=*/false).common/main/or onproduction/common/main/.und(root) itself,intervalFormatFallback,intervalFormatRanges, non-root parent inheritance, and lateral calendar aliases (buddhist→generic,dangi→chinese,islamic-civil→islamic→generic).GenerateProductionDataTestandLdml2JsonConverterTestcovering materialization, draft precedence, parent/lateral/multi-hop alias deduplication, descendant anti-shadowing,alt="variant",-r false,∅∅∅, and raw-vs-production JSON parity.Question for Reviewers — Lateral / Child Deduplication in
GenerateProductionDataWhen a locale has
↑↑↑on both an aliased calendar and its alias target (e.g.,nl.xmlhas↑↑↑on bothgeneric/.../H/Handbuddhist/islamic/islamic-civil.../H/H), or when both a parent and child locale have↑↑↑(e.g.,es.xmlandes_419.xmlboth havegregorian/.../y/y = ↑↑↑):This PR currently deduplicates those entries (materializing only at the ancestor/alias target when it survives with
>= draftstatus, plus emitting an anti-shadowing override if a child overrides the alias target differently). This keeps production XML and ICU.txtbundles smaller and aligns with CLDR's sparse inheritance model, while producing identical resolved output.Would reviewers prefer to keep this deduplication (as implemented), or materialize unconditionally at every
↑↑↑intervalFormatItempath for simpler code at the cost of extra entries in child locales and aliased calendars?Verification
mvn -f tools/pom.xml -pl cldr-code spotless:check— clean.mvn -f tools/pom.xml -pl cldr-code test -Dtest=GenerateProductionDataTest,Ldml2JsonConverterTest,LdmlConvertRulesTest,GenerateDateTimeTestDataTest— all passing.GenerateProductionDataacross all 1,149 locales incommon/main/succeeded with zeroCompareResolveddiffs onintervalFormatpaths and zero missing contributed/approvedintervalFormatItementries inVerifyJson.Related
🤖 This pull request was created by an AI agent working with @sffc.
ALLOW_MANY_COMMITS=true