Language switching does not work in a domain that has already been assigned to the language.
The middleware class: https://github.com/WeFindX/infinity/blob/master/src/apps/core/middleware/language.py
It is necessary to apply the decorator for the function and change the logic of its work. The view of language switcher: https://github.com/django/django/blob/master/django/views/i18n.py#L28
Usage example (with new decorator)
from core.utils import custom_set_language
url(r'^set-language/$', custom_set_language(set_language), name="custom_set_language"),
Decorator description
def custom_set_language(func):
def wrapper(request):
return func(request)
return wrapper
Language switching does not work in a domain that has already been assigned to the language.
The middleware class: https://github.com/WeFindX/infinity/blob/master/src/apps/core/middleware/language.py
It is necessary to apply the decorator for the function and change the logic of its work. The view of language switcher: https://github.com/django/django/blob/master/django/views/i18n.py#L28
Usage example (with new decorator)
Decorator description