refactor: localize UI labels and store filenames

This commit is contained in:
Marcel Peterkau
2026-06-21 18:25:58 +02:00
parent 80d4d5ef90
commit e7962f77e1
9 changed files with 87 additions and 29 deletions
+17
View File
@@ -60,3 +60,20 @@ def test_housekeeper_details_are_multiline() -> None:
assert rendered.splitlines()[0] == "ERROR · invalid_member_record"
assert "Mitgliederakte beschädigt\nFällig:" in rendered
assert rendered.endswith("nicht automatisch überschrieben.")
def test_german_ui_labels_round_trip_to_english_storage_keys() -> None:
from ccma.domain.models import MEMBERSHIP_STATUS_LABELS
from ccma.ui.labels import (
CLAIM_ITEM_TYPE_LABELS,
THEME_LABELS,
display_label,
storage_key,
)
assert display_label(THEME_LABELS, "dark") == "Dunkel"
assert storage_key(THEME_LABELS, "Hell") == "light"
assert display_label(CLAIM_ITEM_TYPE_LABELS, "credit") == "Gutschrift"
assert storage_key(CLAIM_ITEM_TYPE_LABELS, "Dienstleistung") == "service"
assert display_label(MEMBERSHIP_STATUS_LABELS, "active") == "AKTIV"
assert storage_key(MEMBERSHIP_STATUS_LABELS, "EHRENMITGLIED") == "honorary"