www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 35642b465f61bcab002c7bc4c69eea21259359ee
parent 04fb50528c11a3f27bd6103049d28c8262df863f
Author: Simon Kornblith <simon@simonster.com>
Date:   Sun, 22 Jan 2012 11:17:42 -0500

Fix for broken locale retrieval with Ubuntu Firefox Modifications

Diffstat:
Mchrome/content/zotero/xpcom/zotero.js | 14++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -257,8 +257,18 @@ const ZOTERO_CONFIG = { // Locale var prefs = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefService); - this.locale = prefs.getBranch("general.useragent.").getCharPref("locale"); + .getService(Components.interfaces.nsIPrefService), + uaPrefs = prefs.getBranch("general.useragent."); + try { + this.locale = uaPrefs.getComplexValue("locale", Components.interfaces.nsIPrefLocalizedString); + } catch (e) {} + + if(this.locale) { + this.locale = this.locale.toString(); + } else { + this.locale = uaPrefs.getCharPref("locale"); + } + if (this.locale.length == 2) { this.locale = this.locale + '-' + this.locale.toUpperCase(); }