def get(self, key: str): if key in translations[self.lang]: return translations[self.lang][key].replace('\t', '') Logger.err("String {} is not translated to {}!".format(key, self.lang)) if key not in translations["en_US"]: Logger.err("String {} is not translated at all!".format(key)) return "[Missing String]" return translations["en_US"][key].replace('\t', '')
def __init__(self): self.lang = getdefaultlocale()[0] if self.lang not in translations: Logger.err("Locale {} is not translated!".format(self.lang)) self.lang = "en_US"