From 7116c680dfc165e830d8cbbdddc287a4db385f6d Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Tue, 12 May 2026 16:14:47 +0000 Subject: [PATCH] =?UTF-8?q?stage-344:=20maintainer=20fix=20for=20#2142=20f?= =?UTF-8?q?r=20locale=20=E2=80=94=20add=20LOCALES=20tuple=20entries=20+=20?= =?UTF-8?q?=5FLOGIN=5FLOCALE=20block?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #2142 (legeantbleu) added the fr locale to static/i18n.js but didn't update: 1. tests/test_issue1488_composer_voice_buttons.py: two TestComposerVoiceButtonI18n + TestVoiceModePreferenceGate LOCALES tuples needed 'fr' 2. api/routes.py: _LOGIN_LOCALE needed an 'fr' block so the login page localizes for French users (issue #1442 parity contract) 3. tests/test_login_locale_parity.py: the test asserting 'fr' falls-back-to-'en' is inverted — fr now resolves to fr, with sibling assertions for fr-FR and fr-CA Mirrors the stage-340 fix for the it locale (PR #2067 → maintainer adds tuple entries). 46/46 i18n tests pass after fix. --- api/routes.py | 9 +++++++++ tests/test_issue1488_composer_voice_buttons.py | 4 ++-- tests/test_login_locale_parity.py | 4 +++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/api/routes.py b/api/routes.py index 2aaac2bf..31d28286 100644 --- a/api/routes.py +++ b/api/routes.py @@ -1928,6 +1928,15 @@ _LOGIN_LOCALE = { "invalid_pw": "Invalid password", "conn_failed": "Connection failed", }, + "fr": { + "lang": "fr-FR", + "title": "Se connecter", + "subtitle": "Entrez votre mot de passe pour continuer", + "placeholder": "Mot de passe", + "btn": "Se connecter", + "invalid_pw": "Mot de passe invalide", + "conn_failed": "\u00c9chec de la connexion", + }, "es": { "lang": "es-ES", "title": "Iniciar sesi\u00f3n", diff --git a/tests/test_issue1488_composer_voice_buttons.py b/tests/test_issue1488_composer_voice_buttons.py index 787bf8a8..f1e1a78e 100644 --- a/tests/test_issue1488_composer_voice_buttons.py +++ b/tests/test_issue1488_composer_voice_buttons.py @@ -123,7 +123,7 @@ class TestComposerVoiceButtonI18n: "voice_mode_toggle_active", ) - LOCALES = ("en", "it", "ja", "ru", "es", "de", "zh", "zh-Hant", "pt", "ko") + LOCALES = ("en", "fr", "it", "ja", "ru", "es", "de", "zh", "zh-Hant", "pt", "ko") def test_legacy_voice_toggle_key_removed(self): """The old key whose string was 'Voice input' caused the duplicate- @@ -171,7 +171,7 @@ class TestComposerVoiceButtonI18n: class TestVoiceModePreferenceGate: """boot.js must hide btnVoiceMode by default, surface it via Preferences.""" - LOCALES = ("en", "it", "ja", "ru", "es", "de", "zh", "zh-Hant", "pt", "ko") + LOCALES = ("en", "fr", "it", "ja", "ru", "es", "de", "zh", "zh-Hant", "pt", "ko") def test_voice_mode_pref_is_localstorage_backed(self): """The pref reads from localStorage key 'hermes-voice-mode-button'.""" diff --git a/tests/test_login_locale_parity.py b/tests/test_login_locale_parity.py index 77392f96..313e2632 100644 --- a/tests/test_login_locale_parity.py +++ b/tests/test_login_locale_parity.py @@ -293,8 +293,10 @@ def test_login_locale_resolver_handles_new_locales(): assert _resolve_login_locale_key("pt-PT") == "pt" assert _resolve_login_locale_key("ko") == "ko" assert _resolve_login_locale_key("ko-KR") == "ko" + assert _resolve_login_locale_key("fr") == "fr" + assert _resolve_login_locale_key("fr-FR") == "fr" + assert _resolve_login_locale_key("fr-CA") == "fr" # Unknown locale still falls back to en. - assert _resolve_login_locale_key("fr") == "en" assert _resolve_login_locale_key("xx-YY") == "en"