Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/check_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def generate_markdown_report(self) -> str:
"pt_br": "Portuguese (Brazil)",
"pt_pt": "Portuguese (Portugal)",
"ru": "Russian",
"uk": "Ukrainian",
}

for base_name in sorted(self.results.keys()):
Expand Down
25 changes: 25 additions & 0 deletions scripts/check_translations_utest.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,31 @@ def test_lang_names_in_report(self) -> None:
self.assertIn("Portuguese (Brazil)", report, "Portuguese (Brazil) display name should appear for pt_br")


class TestLanguageDisplayNames(unittest.TestCase):
"""Regression tests for locale display names in the markdown report."""

def setUp(self) -> None:
self.checker = TranslationChecker(Path("."))

def test_ukrainian_lang_name_in_report(self) -> None:
"""Ukrainian issues should be labelled by language name, not by the 'uk' code."""
self.checker.results = {
"test-cards-1.0": {
"uk": {
"missing": ["T00004"],
"untranslated": [],
"empty": [],
"file": "test-cards-1.0-uk.yaml",
}
}
}

report = self.checker.generate_markdown_report()

self.assertIn("## Ukrainian", report)
self.assertNotIn("## uk", report)


class TestCoverageBranches(unittest.TestCase):
"""Tests to ensure branch coverage for edge cases."""

Expand Down
Loading