Use case-insensitive term for translation (#552)

pull/559/head
Igor Chubin 4 years ago
parent 7333c4d950
commit 0b8ead03e6

@ -68,7 +68,7 @@ def load_translations():
orig = orig.strip() orig = orig.strip()
translation[orig] = trans translation[orig] = trans
translations[lang] = translation translations[lang.lower()] = translation
return translations return translations
TRANSLATIONS = load_translations() TRANSLATIONS = load_translations()
@ -128,7 +128,7 @@ def translate(text, lang):
""" """
Translate `text` into `lang` Translate `text` into `lang`
""" """
translated = TRANSLATIONS.get(lang, {}).get(text, text) translated = TRANSLATIONS.get(lang, {}).get(text.lower(), text)
if text == translated: if text == translated:
print("%s: %s" % (lang, text)) print("%s: %s" % (lang, text))
return translated return translated

Loading…
Cancel
Save