Open
Bug 992651
Opened 11 years ago
Updated 3 months ago
improve locale sensitive sorting of folder names
Categories
(Thunderbird :: Folder and Message Lists, enhancement)
Thunderbird
Folder and Message Lists
Tracking
(Not tracked)
NEW
People
(Reporter: aceman, Unassigned)
References
Details
(Keywords: intl)
+++ 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.
Severity: normal → enhancement
Keywords: regression
Summary: "Recent Folders" sorting has switched from case insensitive to case sensitive → improve locale sensitive sorting of folder names
Comment 1•10 years ago
|
||
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.
Waldo, something like at https://dxr.mozilla.org/mozilla-central/rev/0418c9abdeb18b216301e91022aa289a45d5b426/browser/components/preferences/languages.js#108 so that we keep the Collator object in a global variable for the folder tree?
If we set the language (first argument) to "undefined", will it pick up the UI language?
Flags: needinfo?(jwalden+bmo)
Comment 3•6 years ago
|
||
That looks about right. Passing |undefined| is probably right, but there's an outside chance something like |navigator.language| is better; I remember some fussiness about exactly how that relates to default language in some contexts. Probably |undefined| is right, tho, if that example does it that way.
Flags: needinfo?(jwalden+bmo)
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•