Locale-Aware Collation with Intl.Collator
String sorting uses Intl.Collator, so accented letters, language-specific letters and case are ordered correctly for the chosen locale. Developers can set the locale and the collator options (sensitivity, caseFirst, ignorePunctuation) globally or per column. The grid creates one collator per configuration and reuses it, which keeps sorting fast.
Planned. This page shows the specification from issue #186. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A grid of surnames that includes Ångström, Zeta, Öberg, Oliver, émile and Emile.
Expected behavior
Switching from 'de' to 'sv' moves Öberg and Ångström after Zeta. Changing sensitivity changes whether 'émile' and 'Emile' are treated as ties. In that case, the tie order follows the stable-sort rule (F13).
Planned API surface
sortLocalecollatorOptionscolumns[].collatorOptionscolumns[].sortLocaleAcceptance criteria
- String comparison delegates to Intl.Collator.prototype.compare (pending)
- A column-level locale and options override the global values (pending)
- The collator instance is cached per unique combination of locale and options (pending)
- An unsupported locale falls back to the runtime default and logs a warning (pending)
- The default locale is the grid's localeText locale, or navigator.language if none is set (pending)