Skip to content

CLDR-19943 Include explicit root numbering systems in cldr-json - #6304

Open
Manishearth wants to merge 1 commit into
unicode-org:mainfrom
Manishearth:CLDR-19943-root-arab-json
Open

Manishearth wants to merge 1 commit into
unicode-org:mainfrom
Manishearth:CLDR-19943-root-arab-json

Conversation

@Manishearth

@Manishearth Manishearth commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Fixes CLDR-19943.

PR body and code is LLM generated:

common/main/root.xml defines explicit non-alias elements for arab (<symbols>, <percentFormats>, <currencyFormats>) and arabext (<symbols>), while all other non-latn numbering systems in root.xml are pure <alias> elements pointing to latn. Because root.xml only lists latn under <defaultNumberingSystem> and <otherNumberingSystems>, Ldml2JsonConverter.getActiveNumberingSystems only returned ["latn"] for root. As a result, cldr-json dropped arab and arabext from cldr-numbers-full/main/und/numbers.json whenever fullNumbers=false, causing downstream consumers such as ICU4X to lose root arab/arabext symbols (e.g., ٫ / ٬ for en-US-u-nu-arab).

Changes:

  • Update Ldml2JsonConverter.getActiveNumberingSystems(CLDRFile) so that for root (XMLSource.ROOT_ID), it also scans the unresolved //ldml/numbers/ paths and includes any numbering system that has explicit non-alias data. This applies to both Ldml2JsonConverter and VerifyJson (which calls the same method), while leaving non-root locales unchanged so stray or legacy non-active numbering systems in other locales are not pulled in.
  • Add unit tests in Ldml2JsonConverterTest covering getActiveNumberingSystems for root (resolved and unresolved) and non-root locales (en, ar, am), as well as end-to-end resolved JSON generation for root.

Sample generated cldr-numbers-full/main/und/numbers.json excerpt (with resolved=true, fullNumbers=false):

        "symbols-numberSystem-arab": {
          "decimal": "٫",
          "group": "٬",
          "list": "؛",
          "percentSign": "٪؜",
          "plusSign": "؜+",
          "minusSign": "؜-",
          "approximatelySign": "~",
          "exponential": "اس",
          "superscriptingExponent": "×",
          "perMille": "؉",
          "infinity": "∞",
          "nan": "NaN",
          "timeSeparator": ":"
        },
        "symbols-numberSystem-arabext": {
          "decimal": "٫",
          "group": "٬",
          "list": "؛",
          "percentSign": "٪",
          "plusSign": "‎+‎",
          "minusSign": "‎-‎",
          "approximatelySign": "~",
          "exponential": "×۱۰^",
          "superscriptingExponent": "×",
          "perMille": "؉",
          "infinity": "∞",
          "nan": "NaN",
          "timeSeparator": "٫"
        },
        "decimalFormats-numberSystem-arab": {
          "standard": "#,##0.###",
          ...
        },
        "decimalFormats-numberSystem-arabext": {
          "standard": "#,##0.###",
          ...
        },
        "currencyFormats-numberSystem-arab": {
          ...
          "standard": "#,##0.00\u00a0¤",
          ...
        }

Pure-alias numbering systems in root.xml (such as adlm, beng, deva, etc.) remain excluded when fullNumbers=false.

Testing:

  • mvn test -pl cldr-code -Dtest="LdmlConvertRulesTest,Ldml2JsonConverterTest"
  • Ran Ldml2JsonConverter -t main -r true -p true -n false -m root and VerifyJson -t main -m root, verifying cldr-numbers-full/main/und/numbers.json and zero missing number values in VerifyJson.

@Manishearth
Manishearth marked this pull request as ready for review December 4, 2026 01:01
@Manishearth

Copy link
Copy Markdown
Member Author

r? @srl295

Not sure if this is the right place for the fix

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant