Report the collations CLDR actually defines - #2989
Merged
Merged
Conversation
sebastienros#2974 made Intl.Locale.prototype.getCollations and Intl.Collator agree on whatever LocaleCollationSupport says, and left open whether what it says is CLDR at all. It is not, in six places. The table is the one CLDR reads two ways: common/bcp47/collation.xml registers the collation identifiers and marks the dead ones deprecated, and common/collation/<language>.xml says which of them a language actually defines. identifier registry per-language file big5han deprecated="true" defined by no locale direct deprecated="true" defined by no locale gb2312 deprecated="true" defined by no locale reformed deprecated="true" defined by no locale ducet current defined by no locale Those five were reachable. "ducet" is the one that is not deprecated - it is registered and current, and CLDR simply ships no data for it, a search of common/collation for a <collation type="ducet"> finding nothing and the hi.xml hit being prose about the DUCET order rather than a type. Either way no locale's file defines it, so no locale's [[co]] list may contain it. The other four are deprecated and equally undefined; "reformed" in particular is the old name for what sv.xml has called "traditional" for many releases. What the per-language files say, minus the "standard" and "search" every one of them carries and the "private-" types CLDR keeps only to be [import]ed: ar compat unchanged de search, phonebook, eor unchanged as phonebk, eor en (no <collations> element at all) "ducet" removed, row now empty es traditional unchanged as trad fi traditional "trad" added, row is new hi standard "direct" removed, row now empty ja private-kana, unihan unchanged ko searchjl, unihan unchanged ln phonetic unchanged si dictionary unchanged as dict sv traditional "reformed" replaced by "trad" vi traditional "trad" added, row is new zh private-pinyin, pinyin, stroke, "big5han" and "gb2312" removed zhuyin, unihan root.xml defines "standard", "search", "eor", "private-unihan" and "emoji", so RootCollations stays ["emoji", "eor"] and every locale keeps getting it. That is also why the en, hi and da rows go away entirely rather than shrinking: once what CLDR does not support is gone, what is left of them is the root pair every locale already gets, which is the same reason fr and tr never needed a row. The rows that remain now say one thing - what this language adds - so the "eor" that ar, es, ja, ko, ln, si, sv and zh used to repeat is gone from them too, while de keeps its own, which de.xml really does define as a German delta on the European ordering rules. Intl.supportedValuesOf("collation") moves with them. https://tc39.es/ecma402/#sec-availablecanonicalcollations wants the collations the implementation provides Intl.Collator functionality for, and intl402/Intl/supportedValuesOf/collations-accepted-by-Collator.js checks exactly that against ten locales - so leaving the five in DefaultCldrProvider.GetSupportedCollations while no locale resolves them any more turns that test red on "big5han is supported by Collator". It is still a third hardcoded list that can drift from the table; deriving it is a separate change. Left alone: yue, which CLDR does give zh's set. It has no collation file, and supplementalData.xml's <parentLocales component="collations"> makes zh_Hant its collation parent, whose file defines only a defaultCollation - which is why node reports pinyin, stroke, unihan and zhuyin for it and ICU's coll/yue.txt is a bare %%ALIAS to zh_Hant. Jint cannot report it yet: "yue" matches no element of IntlUtilities.GetAvailableLocales(), so Intl.Collator.supportedLocalesOf (['yue']) is empty and new Intl.Collator('yue') resolves to the default locale. A row would have advertised four collations Intl.Collator answers "default" for - the disagreement sebastienros#2974 removed, restored on one tag. Reporting them waits on making yue an available Collator locale, and a test pins the current answer and the reason so a later row cannot be added without it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lahma
force-pushed
the
fix/collation-cldr-data
branch
from
August 12, 2026 06:45
3ecdaa8 to
d91412b
Compare
This was referenced Aug 13, 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.
The
LocaleCollationSupporttable diverged from CLDR, and #2974 made the divergence public throughgetCollations(). Every change carries its CLDR citation (common/bcp47/collation.xmldeprecation status + per-localecommon/collation/*.xml, ICU cross-checked at cldrVersion 49):big5han/gb2312(zh),direct(hi),reformed(sv — replaced bytrad, which sv defines)ducet(en) — not deprecated, but no locale defines aducetcollation; thehi.xmlgrep hit is prose about DUCET order. CLDR beats node here: node omits bothducetanddirect, but for different reasons, and the commit says which is which rather than lumping them.tradforfiandvi(both definetraditional);dict(si),trad(es) spelling fixes;ardrops a redundant root echo.yueis deliberately absent, and there is a test pinning why. CLDR routes yue's collations tozh_Hantand node reports them — butIntl.Collator.supportedLocalesOf(['yue'])is[]here (available locales come fromCultureInfo.GetCultures), so adding the row recreated the exact report-vs-accept disagreement #2974 closed, on one tag. Measured, backed out, andLocaleReportsOnlyTheRootCollationsForAnUnavailableLanguagenow stops the row returning before the locale can.The hand-kept
DefaultCldrProvider.GetSupportedCollations()had to move in the same commit — leaving the five removed identifiers in it turns test262'scollations-accepted-by-Collator.jsred. The follow-up PR derives that list so it cannot drift again.Red 16 / green 146, both TFMs. test262 standalone baseline-identical on a quiet machine.
🤖 Generated with Claude Code