Fall back to "en" if we don't find matching translations
In case of no matching translations, target_lang was "None" which blew up things. Fall back to "en" in case we don't find a corresponding translation. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
parent
1aac6a3c3c
commit
d53ca5e506
@ -88,7 +88,7 @@ def get_locale_from_request(request):
|
|||||||
# of accepted locales, and serve the best available locale rather than
|
# of accepted locales, and serve the best available locale rather than
|
||||||
# the most preferred, or fall back to 'en' immediately.
|
# the most preferred, or fall back to 'en' immediately.
|
||||||
target_lang = request.accept_languages.best_match(
|
target_lang = request.accept_languages.best_match(
|
||||||
mg_globals.available_locales)
|
mg_globals.available_locales) or 'en'
|
||||||
return locale_to_lower_upper(target_lang)
|
return locale_to_lower_upper(target_lang)
|
||||||
|
|
||||||
SETUP_GETTEXTS = {}
|
SETUP_GETTEXTS = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user