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
+26
View File
@@ -0,0 +1,26 @@
from __future__ import annotations
from collections.abc import Mapping
THEME_LABELS = {
"dark": "Dunkel",
"light": "Hell",
}
CLAIM_ITEM_TYPE_LABELS = {
"base": "Grundposition",
"product": "Produkt",
"service": "Dienstleistung",
"fee": "Gebühr",
"discount": "Rabatt",
"credit": "Gutschrift",
"correction": "Korrektur",
}
def display_label(labels: Mapping[str, str], key: str) -> str:
return labels.get(key, key)
def storage_key(labels: Mapping[str, str], label: str) -> str:
return next((key for key, value in labels.items() if value == label), label)