1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/packages/lib/models/utils/getCollator.ts

13 lines
366 B
TypeScript
Raw Normal View History

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 };