You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-23 22:36:32 +02:00
Desktop: Fixes #10077: Special characters in notebooks and tags are not sorted alphabetically (#10085)
Co-authored-by: Martin Dörfelt <martin.d@andix.de> Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
This commit is contained in:
12
packages/lib/models/utils/getCollator.ts
Normal file
12
packages/lib/models/utils/getCollator.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
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 };
|
||||
Reference in New Issue
Block a user