improve locale sensitive sorting of folder names

NEW
Unassigned

Status

Thunderbird
Folder and Message Lists
--
enhancement
3 years ago
3 years ago

People

(Reporter: aceman, Unassigned)

Tracking

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
+++ This bug was initially created as a clone of Bug #981405 +++

Currently the folder sorting function mailnews/base/util/folderUtils.jsm::folderNameCompare() we use to sort folders in some folder pane modes (when we can't use compareSortKeys()) unconditionally uses .toLocaleLowerCase on both the strings to force a case insensitive comparison.

It seems this could be improved to use the new localeCompare functionality at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare, like this:
aString1.localeCompare(aString2, undefined, {usage:"sort", sensitivity: "accent"})

But for that TB needs to switch to the new internationalization API, something like in bug 853301.
(Reporter)

Updated

3 years ago
Severity: normal → enhancement
Keywords: regression
Summary: "Recent Folders" sorting has switched from case insensitive to case sensitive → improve locale sensitive sorting of folder names
Note that rather than repeatedly using localeCompare, it would be better to create an Intl.Collator instance and use it repeatedly, to save on work needed to set up collation resources.
You need to log in before you can comment on or make changes to this bug.