Collator

new Intl.Collator(locales, options) compares strings by a language's sorting rules; pass its compare method to sort() or toSorted(). The default sort compares UTF-16 code units, putting capitals first and accented letters after z. Options: sensitivity (base treats a, á and A as equal; accent, case, variant), numeric: true ("2" before "10"), caseFirst (upper, lower) and usage: 'search'; the extension -u-co- selects variant orders such as pinyin, stroke or German phonebk.

Sorting words, file names and Chinese city namesJavaScriptLive
const words = ['zebra', 'Äpfel', 'apple', 'Zoo'];
console.log(words.toSorted(), words.toSorted(new Intl.Collator('de').compare));
console.log(words.toSorted(new Intl.Collator('sv').compare));
const files = ['file10.txt', 'file2.txt', 'File1.txt'];
console.log(files.toSorted(new Intl.Collator('en', { numeric: true }).compare));
const base = new Intl.Collator('fr', { sensitivity: 'base' });
console.log(base.compare('résumé', 'RESUME'), new Intl.Collator('fr').compare('résumé', 'RESUME'));
console.log(new Intl.Collator('zh-u-co-pinyin').compare('北京', '上海'),
  new Intl.Collator('zh-u-co-stroke').compare('北京', '上海'));

German sorts Ä with A; Swedish places it after Z. Beijing precedes Shanghai in pinyin order but follows it in stroke order.