mirror of
https://github.com/zotero/zotero.git
synced 2026-10-08 03:08:19 +00:00
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
This commit is contained in:
parent
1958505596
commit
69c1dc17be
1 changed files with 10 additions and 3 deletions
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue