diff --git a/Calendar/E-Paper.py b/Calendar/E-Paper.py index ea477c6..a43bcc2 100644 --- a/Calendar/E-Paper.py +++ b/Calendar/E-Paper.py @@ -24,9 +24,9 @@ import IcalEvents import RssParserPosts all_locales = locale.locale_alias -if language not in all_locales.keys(): +if language.lower() not in all_locales.keys(): raise Exception("The locale for \"%s\" is currently not supported! If you need support, please open an issue on github." % language) -locale.setlocale(locale.LC_ALL, "%s.%s" % (all_locales[language].split('.')[0], datetime_encoding)) +locale.setlocale(locale.LC_ALL, "%s.%s" % (all_locales[language.lower()].split('.')[0], datetime_encoding)) debug = DebugConsole() output_adapters = [] diff --git a/Calendar/Translator.py b/Calendar/Translator.py index 218a6a0..9d27774 100644 --- a/Calendar/Translator.py +++ b/Calendar/Translator.py @@ -12,6 +12,8 @@ def translate(phrase, target_lang = language, dictionary_collection = dictionary if target_lang in dictionary.keys(): return dictionary[target_lang] + elif '_' in target_lang and target_lang.split('_')[0] in dictionary.keys(): + return dictionary[target_lang.split('_')[0]] else: return dictionary[default_language]