From 813f55d0244d06fb62b1808b3eae60f2332f732d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 8 Jul 2014 09:47:03 -0400 Subject: [PATCH] Natural sorting of numbers ("1" < "2" < "10") This needs testing to see if it has any other unwanted effects. Closes Trac ticket 1031 --- chrome/content/zotero/xpcom/zotero.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index ced3b707a..28e12c0bc 100644 --- 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);