#33668: i18n set_language not working in Safari
-------------------------------------+-------------------------------------
Reporter: yopiti | Owner: nobody
Type: Bug | Status: new
Component: | Version: 4.0
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by yopiti:
Old description:
> Trying to implement a session / cookie based translation selector.
>
> This code correctly sets the language in Chrome (100) & Firefox (99.0.1),
> but not in Safari (15.4).
>
> {% load i18n %}
>
> <form action="{% url 'set_language' %}" method="post">{% csrf_token %}
> <input name="next" type="hidden" value="{{ redirect_to }}" />
> <select name="language">
> {% get_current_language as LANGUAGE_CODE %}
> {% get_available_languages as LANGUAGES %}
> {% get_language_info_list for LANGUAGES as languages %}
> {% for language in languages %}
> <option value="{{ language.code }}"{% if language.code ==
> LANGUAGE_CODE %} selected="selected"{% endif %}>
> {{ language.name_local }} ({{ language.code }})
> </option>
> {% endfor %}
> </select>
> <input type="submit" value="Go" />
> </form>
>
> Request is made, its redirected to /i18n/setlang/ and back to the
> original page, but not switching language.
New description:
Trying to implement a session / cookie based translation selector.
This code correctly sets the language in Chrome (100) & Firefox (99.0.1),
but not in Safari (15.4).
{{{
{% load i18n %}
<form action="{% url 'set_language' %}" method="post">{% csrf_token %}
<input name="next" type="hidden" value="{{ redirect_to }}" />
<select name="language">
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
<option value="{{ language.code }}"{% if language.code ==
LANGUAGE_CODE %} selected="selected"{% endif %}>
{{ language.name_local }} ({{ language.code }})
</option>
{% endfor %}
</select>
<input type="submit" value="Go" />
</form>
}}}
Request is made, its redirected to /i18n/setlang/ and back to the original
page, but not switching language.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/33668#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018070198cdb-2d6911f0-c96f-4984-a61b-8d3660f4b815-000000%40eu-central-1.amazonses.com.