commit 813f55d0244d06fb62b1808b3eae60f2332f732d
parent 87a0df43d840da44e64bb0f05e64956e94b99d6e
Author: Dan Stillman <dstillman@zotero.org>
Date: Tue, 8 Jul 2014 09:47:03 -0400
Natural sorting of numbers ("1" < "2" < "10")
This needs testing to see if it has any other unwanted effects.
Closes Trac ticket 1031
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js
@@ -1488,7 +1488,10 @@ Components.utils.import("resource://gre/modules/Services.jsm");
var locale = appLocale.getCategory('NSILOCALE_COLLATE');
// Extract a valid language tag
locale = locale.match(/^[a-z]{2}(\-[A-Z]{2})?/)[0];
- var collator = new Intl.Collator(locale, { ignorePunctuation: true });
+ var collator = new Intl.Collator(locale, {
+ ignorePunctuation: true,
+ numeric: true
+ });
}
catch (e) {
Zotero.debug(e, 1);