Merge remote-tracking branch 'lang/master'

This commit is contained in:
Ozzieisaacs
2018-11-17 16:32:55 +01:00
2 changed files with 37 additions and 32 deletions
+5
View File
@@ -198,6 +198,11 @@ def get_locale():
return user.locale
translations = [item.language for item in babel.list_translations()] + ['en']
preferred = [x.replace('-', '_') for x in request.accept_languages.values()]
# In the case of Simplified Chinese, Accept-Language is "zh-CN", while our translation of Simplified Chinese is "zh_Hans_CN".
# TODO: This is Not a good solution, should be improved.
if "zh_CN" in preferred:
return "zh_Hans_CN"
return negotiate_locale(preferred, translations)