mirror of
https://github.com/chubin/wttr.in
synced 2025-01-12 03:58:45 +00:00
Use case-insensitive term for translation (#552)
This commit is contained in:
parent
7333c4d950
commit
0b8ead03e6
1 changed files with 2 additions and 2 deletions
|
@ -68,7 +68,7 @@ def load_translations():
|
|||
orig = orig.strip()
|
||||
|
||||
translation[orig] = trans
|
||||
translations[lang] = translation
|
||||
translations[lang.lower()] = translation
|
||||
return translations
|
||||
TRANSLATIONS = load_translations()
|
||||
|
||||
|
@ -128,7 +128,7 @@ def translate(text, lang):
|
|||
"""
|
||||
Translate `text` into `lang`
|
||||
"""
|
||||
translated = TRANSLATIONS.get(lang, {}).get(text, text)
|
||||
translated = TRANSLATIONS.get(lang, {}).get(text.lower(), text)
|
||||
if text == translated:
|
||||
print("%s: %s" % (lang, text))
|
||||
return translated
|
||||
|
|
Loading…
Reference in a new issue