mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-25 03:00:23 +00:00
stage-344: maintainer fix for #2142 fr locale — add LOCALES tuple entries + _LOGIN_LOCALE block
#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.
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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'."""
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user