mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-27 10:32:58 +02:00
e9ebd845b9
Co-authored-by: Martin Dörfelt <martin.d@andix.de> Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
13 lines
366 B
TypeScript
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 };
|