From 4d5f50bf74e23e2ee798e27df367b7b86f81221c Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sat, 9 Apr 2011 16:15:36 +0000 Subject: [PATCH] get locale directly from prefs (necessary due to landing of bug 646428 on mozilla-central) --- chrome/content/zotero/xpcom/zotero.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 61b8653eb..ef14c9a7a 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -237,14 +237,12 @@ var Zotero = new function(){ this.isLinux = (this.platform.substr(0, 5) == "Linux"); this.oscpu = win.navigator.oscpu; - // Locale - var ph = Components.classes["@mozilla.org/network/protocol;1?name=http"]. - getService(Components.interfaces.nsIHttpProtocolHandler); - if (ph.language.length == 2) { - this.locale = ph.language + '-' + ph.language.toUpperCase(); - } - else { - this.locale = ph.language; + // Locale + var prefs = Components.classes["@mozilla.org/preferences-service;1"] + .getService(Components.interfaces.nsIPrefService); + this.locale = prefs.getBranch("general.useragent.").getCharPref("locale"); + if (this.locale.length == 2) { + this.locale = this.locale + '-' + this.locale.toUpperCase(); } // Load in the localization stringbundle for use by getString(name)