Locale fix

Date formatting sometimes didn't use the correct locale encoding
This commit is contained in:
Peter Šurda 2016-04-27 10:07:49 +02:00
parent c29f266020
commit 92e3e62640

View File

@ -106,6 +106,7 @@ def change_translation(locale):
lang = pythonlocale.normalize(l10n.getTranslationLanguage())
try:
pythonlocale.setlocale(pythonlocale.LC_ALL, lang)
l10n.encoding = pythonlocale.nl_langinfo(pythonlocale.CODESET)
except:
logger.error("Failed to set locale to %s", lang, exc_info=True)