1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-06 23:56:13 +02:00
Files
joplin/packages/lib/models/utils/getCollator.ts
2024-03-20 11:17:46 +00:00

13 lines
366 B
TypeScript

import { currentLocale, languageCodeOnly } from '../../locale';
function getCollator(locale: string = getCollatorLocale()) {
return new Intl.Collator(locale, { numeric: true, sensitivity: 'accent' });
}
function getCollatorLocale() {
const collatorLocale = languageCodeOnly(currentLocale());
return collatorLocale;
}
export { getCollator, getCollatorLocale };