From f6bd7269aeb4775aaf9126027d217a2c5301eceb Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 5 Mar 2022 00:47:59 -0500 Subject: [PATCH] Fix changing locale via keyboard on Windows (And maybe Linux) https://forums.zotero.org/discussion/94866/beta-6-0-no-shortcut-key-could-be-applied-in-language-of-advanced-setting --- chrome/content/zotero/preferences/preferences_advanced.js | 7 +++++-- chrome/content/zotero/preferences/preferences_advanced.xul | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/preferences/preferences_advanced.js b/chrome/content/zotero/preferences/preferences_advanced.js index 84940319f1..4d4e949a16 100644 --- a/chrome/content/zotero/preferences/preferences_advanced.js +++ b/chrome/content/zotero/preferences/preferences_advanced.js @@ -629,15 +629,18 @@ Zotero_Preferences.Advanced = { onLocaleChange: function () { var requestedLocale = Services.locale.getRequestedLocale(); var menu = document.getElementById('locale-menu'); + if (menu.value == 'automatic') { // Changed if not already set to automatic (unless we have the automatic locale name, // meaning we just switched away to the same manual locale and back to automatic) - var changed = requestedLocale && menu.label != this._getAutomaticLocaleMenuLabel(); + var changed = requestedLocale + && requestedLocale == Zotero.locale + && menu.label != this._getAutomaticLocaleMenuLabel(); Services.locale.setRequestedLocales(null); } else { // Changed if moving to a locale other than the current one - var changed = Zotero.locale != menu.value + var changed = requestedLocale != menu.value Services.locale.setRequestedLocales([menu.value]); } diff --git a/chrome/content/zotero/preferences/preferences_advanced.xul b/chrome/content/zotero/preferences/preferences_advanced.xul index 518198f8a5..ffb8d2b2dc 100644 --- a/chrome/content/zotero/preferences/preferences_advanced.xul +++ b/chrome/content/zotero/preferences/preferences_advanced.xul @@ -85,8 +85,8 @@