From f0f916595862a68dfab4725817dff66653b5aaad Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 08:43:40 +0000 Subject: [PATCH 1/2] Initial plan From 08fabe154a35e9f8def21f86178b3619e021a595 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 08:47:56 +0000 Subject: [PATCH 2/2] fix(test): remove tests that check specific translation content Remove three tests that asserted exact translated strings for German, French, and Chinese locales. These tests broke whenever translation files were updated externally. Replace content-checking tests with behavioral assertions: - Translated values are non-empty strings (not the raw key) - Fallback and None-locale return the English translation - Placeholder interpolation injects the kwarg value Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- tests/test_i18n.py | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/tests/test_i18n.py b/tests/test_i18n.py index 3bc884fe..30dc804b 100644 --- a/tests/test_i18n.py +++ b/tests/test_i18n.py @@ -70,34 +70,28 @@ class TestTranslate: reload_translations() @pytest.mark.unit - def test_translate_english_key(self) -> None: - """English keys should resolve to English text.""" + def test_translate_known_key_returns_non_empty_string(self) -> None: + """A valid key should resolve to a non-empty string (not the key itself).""" result = translate("nav.dashboard", "en") - assert result == "Dashboard" + assert isinstance(result, str) + assert result != "" + assert result != "nav.dashboard" @pytest.mark.unit - def test_translate_german_key(self) -> None: - """German locale should return German text.""" - result = translate("nav.dashboard", "de") - assert result == "Übersicht" - - @pytest.mark.unit - def test_translate_french_key(self) -> None: - """French locale should return French text.""" - result = translate("nav.dashboard", "fr") - assert result == "Tableau de bord" - - @pytest.mark.unit - def test_translate_chinese_key(self) -> None: - """Chinese locale should return Chinese text.""" - result = translate("nav.dashboard", "zh") - assert result == "仪表盘" + def test_translate_non_english_locale_returns_value(self) -> None: + """Non-English locales should return a non-empty translated value.""" + for locale in ("de", "fr", "zh"): + result = translate("nav.dashboard", locale) + assert isinstance(result, str) + assert result != "" + assert result != "nav.dashboard" @pytest.mark.unit def test_translate_fallback_to_english(self) -> None: - """Unknown locale falls back to English.""" + """Unknown locale falls back to English translation.""" result = translate("nav.dashboard", "xx") - assert result == "Dashboard" + english = translate("nav.dashboard", "en") + assert result == english @pytest.mark.unit def test_translate_missing_key_returns_key(self) -> None: @@ -109,13 +103,15 @@ class TestTranslate: def test_translate_none_locale_uses_default(self) -> None: """None locale defaults to English.""" result = translate("nav.dashboard", None) - assert result == "Dashboard" + english = translate("nav.dashboard", "en") + assert result == english @pytest.mark.unit def test_translate_with_kwargs(self) -> None: """Placeholders should be interpolated via kwargs.""" result = translate("footer.copyright", "en", year="2025") - assert result == "DocuElevate 2025" + assert "2025" in result + assert result != "footer.copyright" @pytest.mark.unit def test_translate_with_kwargs_german(self) -> None: