mirror of
https://git.hiabuto.net/C3MA/CCMA.git
synced 2026-07-01 03:04:52 +02:00
refactor: localize UI labels and store filenames
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user