From ceb4c5eb61d750f33609c4e79b7381d91ed88b65 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index d9ddf2f1ca..2786403729 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -1498,15 +1498,15 @@ Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); if (Services.locale.getAppLocale) { - var appLocale = Services.locale.getAppLocale(); + var locale = Services.locale.getAppLocale(); } // Fx <=53 else { - var appLocale = Services.locale.getApplicationLocale(); + var locale = Services.locale.getApplicationLocale(); + locale = locale.getCategory('NSILOCALE_COLLATE'); } 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, { @@ -1516,7 +1516,7 @@ Components.utils.import("resource://gre/modules/Services.jsm"); }); } catch (e) { - Zotero.debug(e, 1); + Zotero.logError(e); // If there's an error, just skip sorting collator = {