From a73b2403b0f775cc966141799e59a72303787e1c Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 27 May 2017 05:29:34 -0400 Subject: [PATCH] Fix getLocaleCollation() in Firefox 54 --- chrome/content/zotero/xpcom/zotero.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index d0260f2e86..72e515a9c9 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -1338,17 +1338,16 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js"); } try { - 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, { + appLocale = appLocale.match(/^[a-z]{2}(\-[A-Z]{2})?/)[0]; + var collator = new Intl.Collator(appLocale, { ignorePunctuation: true, numeric: true, sensitivity: 'base' }); } catch (e) { - Zotero.debug(e, 1); + Zotero.logError(e); // If there's an error, just skip sorting collator = {