bmc_hub/tests/test_danish_ui_text.py

45 lines
1.4 KiB
Python
Raw Permalink Normal View History

from pathlib import Path
UI_FILES = [
"app/auth/frontend/login.html",
"app/auth/frontend/2fa_setup.html",
"app/dashboard/frontend/mission_control.html",
"app/dashboard/frontend/mission_control_v2.html",
"app/economy/frontend/time_queue.html",
"app/modules/calendar/templates/index.html",
"app/modules/hardware/templates/detail.html",
"app/modules/hardware/templates/eset_import.html",
"app/modules/sag/templates/detail_v3.html",
"app/modules/sag/templates/index.html",
"app/products/frontend/detail.html",
"app/products/frontend/list.html",
"app/settings/frontend/settings.html",
"app/settings/frontend/migrations.html",
"app/subscriptions/frontend/list.html",
"app/timetracking/frontend/employee_log.html",
"app/timetracking/frontend/service_contract_report.html",
"static/js/task-template-selector.js",
]
def test_active_danish_ui_uses_danish_characters_in_common_words():
source = "\n".join(Path(filename).read_text() for filename in UI_FILES)
forbidden_visible_spellings = [
"Aabn ",
"Aabne sager",
"Indlaeser",
"Maaned",
"Netvaerksfejl",
"Opsaet ",
"Paakraevet",
"Soeger...",
"Tilfoej",
"Vaelg ",
"leverandoer",
"paakraevet",
]
for spelling in forbidden_visible_spellings:
assert spelling not in source, f"ASCII-dansk fundet i UI: {spelling}"