46 lines
2.2 KiB
Python
46 lines
2.2 KiB
Python
from enum import Enum
|
|
class Language(Enum):
|
|
ENGLISH = 1
|
|
GERMAN = 2
|
|
|
|
class Translater:
|
|
def __init__(self, language):
|
|
self.language = language
|
|
self.dict_german = { "Irrigation": "Bewässerungs",
|
|
"system": "system",
|
|
"Dashboard": "Startseite",
|
|
"irrigation zones": "Bewässerungszonen",
|
|
"blocking times": "Sperrzeiten",
|
|
"system settings": "Systemeinstellungen",
|
|
"Zone": "Zone",
|
|
"state": "Status",
|
|
"operating mode": "Betriebsmodus",
|
|
"actual humidity": "momentane Feuchtigkeit",
|
|
"desired humidity": "gewünschte Feuchtigkeit",
|
|
"switched on": "eingeschaltet",
|
|
"switched off": "ausgeschaltet",
|
|
"turn on": "einschalten",
|
|
"turn off": "ausschalten",
|
|
"manual mode": "Handbetrieb",
|
|
"automatic mode": "Automatikbetrieb",
|
|
"switch to manual mode": "Auf Handbetrieb umstellen",
|
|
"switch to automatic mode": "Auf Automatikbetrieb umstellen",
|
|
"minutes": "Minuten",
|
|
"until": "bis",
|
|
"irragation is planed for": "Bewässerung ist geplant für",
|
|
"planed irrigationjobs": "geplante Bewässerungsaufträge",
|
|
"planed duration": "geplante Dauer",
|
|
"cancel": "abbrechen",
|
|
"delete": "löschen",
|
|
}
|
|
|
|
|
|
def getTranslation(self, english_String):
|
|
match self.language:
|
|
case Language.ENGLISH:
|
|
return english_String
|
|
case Language.GERMAN:
|
|
return self.dict_german[english_String]
|
|
case _:
|
|
return "no translations for these language"
|