[FIX] website: The default language does not use the configuration
The request language must be a fallback if the current website does not have a default language
This commit is contained in:
@@ -179,8 +179,8 @@ class Http(models.AbstractModel):
|
||||
nearest_lang = not func and cls.get_nearest_lang(path[1])
|
||||
url_lang = nearest_lang and path[1]
|
||||
preferred_lang = ((cook_lang if cook_lang in langs else False)
|
||||
or (not is_a_bot and cls.get_nearest_lang(request.lang))
|
||||
or request.website.default_lang_code)
|
||||
or request.website.default_lang_code
|
||||
or (not is_a_bot and cls.get_nearest_lang(request.lang)))
|
||||
|
||||
request.lang = context['lang'] = nearest_lang or preferred_lang
|
||||
# if lang in url but not the displayed or default language --> change or remove
|
||||
|
||||
Reference in New Issue
Block a user