Open Bug 992651 Opened 11 years ago Updated 2 years ago

improve locale sensitive sorting of folder names

Categories

(Thunderbird :: Folder and Message Lists, enhancement)

enhancement

Tracking

(Not tracked)

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
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.
Keywords: intl
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)
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)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.