mirror of
https://github.com/zotero/zotero.git
synced 2026-10-10 03:28:10 +00:00
Sort strings naturally or alphabetically (#5075)
Hidden setting. If true, use natural collection sorting matching the current behavior. If false, use conventional alphabetic sorting.
This commit is contained in:
parent
c93a0e0e80
commit
f4b531e657
2 changed files with 5 additions and 2 deletions
|
|
@ -244,12 +244,14 @@ Zotero.Intl = new function () {
|
|||
}
|
||||
|
||||
function getLocaleCollation() {
|
||||
var naturalSorting = Zotero.Prefs.get('naturalSorting');
|
||||
|
||||
try {
|
||||
// DEBUG: Is this necessary, or will Intl.Collator just default to the same locales we're
|
||||
// passing manually?
|
||||
let locales = Services.locale.appLocalesAsBCP47;
|
||||
var collator = new Intl.Collator(locales, {
|
||||
numeric: true,
|
||||
numeric: naturalSorting,
|
||||
sensitivity: 'base'
|
||||
});
|
||||
}
|
||||
|
|
@ -260,7 +262,7 @@ Zotero.Intl = new function () {
|
|||
try {
|
||||
Zotero.logError("Falling back to en-US sorting");
|
||||
collator = new Intl.Collator(['en-US'], {
|
||||
numeric: true,
|
||||
numeric: naturalSorting,
|
||||
sensitivity: 'base'
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ pref("extensions.zotero.autoRenameFiles.fileTypes", "application/pdf,application
|
|||
pref("extensions.zotero.attachmentRenameTemplate", "{{ firstCreator suffix=\" - \" }}{{ year suffix=\" - \" }}{{ title truncate=\"100\" }}");
|
||||
pref("extensions.zotero.capitalizeTitles", false);
|
||||
pref("extensions.zotero.launchNonNativeFiles", false);
|
||||
pref("extensions.zotero.naturalSorting", true);
|
||||
pref("extensions.zotero.sortNotesChronologically", false);
|
||||
pref("extensions.zotero.sortNotesChronologically.reader", true);
|
||||
pref("extensions.zotero.sortAttachmentsChronologically", false);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue