mirror of
https://github.com/zotero/zotero.git
synced 2026-09-20 00:12:49 +00:00
Fix for broken locale retrieval with Ubuntu Firefox Modifications
This commit is contained in:
parent
04fb50528c
commit
35642b465f
1 changed files with 12 additions and 2 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue