{{{#!django
{% get_current_language as CURRENT_LANGUAGE_CODE %}
{% get_available_languages as AVAILABLE_LANGUAGES %}
{% get_language_info_list for AVAILABLE_LANGUAGES as languages %}
{% for lang in languages %}
{% if lang.code != CURRENT_LANGUAGE_CODE %}
<form id="language-switcher"
action="{% url 'set_language' %}"
method="post">
{% csrf_token %}
<input name="language" type="hidden" value="{{ lang.code }}">
<button type="submit">{{ lang.name_local }}</button>
</form>
{% endif %}
{% endfor %}
}}}
{{{#!python
urlpatterns = i18n_patterns(
path('admin/', admin.site.urls),
path('', include('core.urls')),
path('contact/', include('contact.urls')),
path('articles/', include('articles.urls')),
prefix_default_language=False,
)
urlpatterns += [path("i18n/", include("django.conf.urls.i18n")),]
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35009>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by KILLIAN.arts):
I just tried set_language with a fresh install and it has the same issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/35009#comment:1>
* status: new => closed
* resolution: => duplicate
Comment:
Duplicate of #28567.
--
Ticket URL: <https://code.djangoproject.com/ticket/35009#comment:2>