From 69c1dc17be0c754b95ec6f545253d12a28826dbd Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 27 Mar 2007 17:57:33 +0000 Subject: [PATCH] Addresses #541, Option to force use of English (or any arbitrary locale?) in bibliographies Set Zotero.locale based on the locale of the Firefox build rather than the system locale --- chrome/content/zotero/xpcom/zotero.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 6155a07b32..2e809347b2 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -120,12 +120,19 @@ var Zotero = new function(){ this.isWin = (this.platform.substr(0, 3) == "Win"); // Locale - var localeService = Components.classes['@mozilla.org/intl/nslocaleservice;1']. - getService(Components.interfaces.nsILocaleService); - this.locale = localeService.getLocaleComponentForUserAgent(); + 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; + } // Load in the localization stringbundle for use by getString(name) var src = 'chrome://zotero/locale/zotero.properties'; + var localeService = Components.classes['@mozilla.org/intl/nslocaleservice;1']. + getService(Components.interfaces.nsILocaleService); var appLocale = localeService.getApplicationLocale(); var stringBundleService =