get locale directly from prefs (necessary due to landing of bug 646428 on mozilla-central)

This commit is contained in:
Simon Kornblith 2011-04-09 16:15:36 +00:00
parent 7da6520292
commit 4d5f50bf74

View File

@ -237,14 +237,12 @@ var Zotero = new function(){
this.isLinux = (this.platform.substr(0, 5) == "Linux"); this.isLinux = (this.platform.substr(0, 5) == "Linux");
this.oscpu = win.navigator.oscpu; this.oscpu = win.navigator.oscpu;
// Locale // Locale
var ph = Components.classes["@mozilla.org/network/protocol;1?name=http"]. var prefs = Components.classes["@mozilla.org/preferences-service;1"]
getService(Components.interfaces.nsIHttpProtocolHandler); .getService(Components.interfaces.nsIPrefService);
if (ph.language.length == 2) { this.locale = prefs.getBranch("general.useragent.").getCharPref("locale");
this.locale = ph.language + '-' + ph.language.toUpperCase(); if (this.locale.length == 2) {
} this.locale = this.locale + '-' + this.locale.toUpperCase();
else {
this.locale = ph.language;
} }
// Load in the localization stringbundle for use by getString(name) // Load in the localization stringbundle for use by getString(name)