Fix some locale detection bugs after 513f7d6555
- When upgrading from Fx52, don't show "Automatic" for a manually selected locale. - Make sure Zotero.locale is always set to a known language tag - Fix inconsistencies between Zotero.Locale.availableLocales and chrome.manifest
This commit is contained in:
parent
5779b60418
commit
e7d0e282e7
3 changed files with 8 additions and 5 deletions
|
@ -470,7 +470,6 @@ Zotero_Preferences.Advanced = {
|
||||||
|
|
||||||
|
|
||||||
refreshLocale: function () {
|
refreshLocale: function () {
|
||||||
var requestedLocale = Services.locale.getRequestedLocale();
|
|
||||||
var autoLocaleName, currentValue;
|
var autoLocaleName, currentValue;
|
||||||
|
|
||||||
// If matching OS, get the name of the current locale
|
// If matching OS, get the name of the current locale
|
||||||
|
@ -481,7 +480,7 @@ Zotero_Preferences.Advanced = {
|
||||||
// Otherwise get the name of the locale specified in the pref
|
// Otherwise get the name of the locale specified in the pref
|
||||||
else {
|
else {
|
||||||
autoLocaleName = Zotero.getString('zotero.preferences.locale.automatic');
|
autoLocaleName = Zotero.getString('zotero.preferences.locale.automatic');
|
||||||
currentValue = requestedLocale;
|
currentValue = Zotero.locale;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Populate menu
|
// Populate menu
|
||||||
|
|
|
@ -41,6 +41,7 @@ Zotero.Intl = new function () {
|
||||||
else if (prevLocale) {
|
else if (prevLocale) {
|
||||||
try {
|
try {
|
||||||
Services.locale.setRequestedLocales([prevLocale]);
|
Services.locale.setRequestedLocales([prevLocale]);
|
||||||
|
Zotero.Prefs.set('intl.regional_prefs.use_os_locales', false, true);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
// Don't panic if the value is not a valid locale code
|
// Don't panic if the value is not a valid locale code
|
||||||
|
@ -58,7 +59,10 @@ Zotero.Intl = new function () {
|
||||||
[pluralFormGet, pluralFormNumForms] = PluralForm.makeGetter(parseInt(getIntlProp('pluralRule', 1)));
|
[pluralFormGet, pluralFormNumForms] = PluralForm.makeGetter(parseInt(getIntlProp('pluralRule', 1)));
|
||||||
setOrClearIntlPref('intl.accept_languages', 'string');
|
setOrClearIntlPref('intl.accept_languages', 'string');
|
||||||
|
|
||||||
Zotero.locale = Services.locale.getRequestedLocale();
|
Zotero.locale = Zotero.Utilities.Internal.resolveLocale(
|
||||||
|
Services.locale.getRequestedLocale(),
|
||||||
|
Services.locale.getAvailableLocales()
|
||||||
|
);
|
||||||
|
|
||||||
// Also load the brand as appName
|
// Also load the brand as appName
|
||||||
Zotero.appName = Services.strings
|
Zotero.appName = Services.strings
|
||||||
|
|
|
@ -15,8 +15,8 @@ Zotero.Locale = {
|
||||||
'es-ES': 'Español',
|
'es-ES': 'Español',
|
||||||
'et-EE': 'Eesti keel',
|
'et-EE': 'Eesti keel',
|
||||||
'fa': 'فارسی',
|
'fa': 'فارسی',
|
||||||
'fi': 'suomi',
|
'fi-FI': 'suomi',
|
||||||
'fr': 'Français',
|
'fr-FR': 'Français',
|
||||||
'gl-ES': 'Galego',
|
'gl-ES': 'Galego',
|
||||||
'hu-HU': 'magyar',
|
'hu-HU': 'magyar',
|
||||||
'id-ID': 'Bahasa Indonesia',
|
'id-ID': 'Bahasa Indonesia',
|
||||||
|
|
Loading…
Add table
Reference in a new issue