Add i18n language switcher and localized URL routing
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
{% load i18n %}
|
||||
<div class="header-right">
|
||||
<form action="{% url set_language %}" method="post" class="language-switcher-form d-inline-flex align-items-center me-2" aria-label="Language switcher">
|
||||
{% csrf_token %}
|
||||
<input name="next" type="hidden" value="{{ request.get_full_path }}">
|
||||
<label for="header-language-switcher" class="visually-hidden">{% trans "Language" %}</label>
|
||||
<select id="header-language-switcher" name="language" class="form-select form-select-sm" style="width:auto; min-width:84px;" onchange="this.form.submit()">
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
{% get_available_languages as LANGUAGES %}
|
||||
{% for code, name in LANGUAGES %}
|
||||
<option value="{{ code }}" {% if code == LANGUAGE_CODE %}selected{% endif %}>{{ code|upper }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</form>
|
||||
|
||||
<a tabindex="0" aria-label="Open Search" role="search" class="search-toggler user-button menu-circle">
|
||||
<i class="fa fa-search"></i>
|
||||
</a>
|
||||
<a href="{% url customer:summary %}" aria-label="{% trans Customer summary %}" class="user-button menu-circle"><i class="fa fa-user-solid"></i></a>
|
||||
{% include oxyan/headers/partials/mini_basket.html %}
|
||||
</div>
|
||||
|
||||
<div class="alert-messages-header" aria-live="polite">
|
||||
{% include "oscar/partials/alert_messages.html" with messages=messages %}
|
||||
</div>
|
||||
Reference in New Issue
Block a user