From be0ddf25e423921a5391fa7fe90afe32c3e4b201 Mon Sep 17 00:00:00 2001 From: bodybybuddha Date: Mon, 17 Sep 2018 13:03:29 -0400 Subject: [PATCH] Fix for #621 - Login page always in english --- cps/web.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cps/web.py b/cps/web.py index 2de1bbd3..d4f79b88 100644 --- a/cps/web.py +++ b/cps/web.py @@ -214,7 +214,8 @@ def get_locale(): # if a user is logged in, use the locale from the user settings user = getattr(g, 'user', None) if user is not None and hasattr(user, "locale"): - return user.locale + if user.nickname != 'Guest': # if the account is the guest account bypass the config lang settings + return user.locale translations = [item.language for item in babel.list_translations()] + ['en'] preferred = [x.replace('-', '_') for x in request.accept_languages.values()] return negotiate_locale(preferred, translations)