// Alphabetical order in the UI language: Hungarian puts "Ö" after "O" and "Cs" after "Cu". A // bare `localeCompare` compares in the BROWSER's locale; the server sorts by the same ICU rules // (backend `app/collation.py`), so a list sorted here agrees with one the server sorted. Its own // module, apart from lib/format.ts, because it needs no i18n: the pure sort helpers import it. const collators = new Map(); export function compareText(a: string, b: string, lang: string): number { let c = collators.get(lang); if (!c) { c = new Intl.Collator(lang); collators.set(lang, c); } return c.compare(a, b); }