Compare commits

...

1 Commits

Author SHA1 Message Date
Raphael Michel
118c206bb1 Set locale properly if locale is already in query string 2025-01-07 11:05:15 +01:00
2 changed files with 4 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
{% extends "pretixpresale/base.html" %}
{% load urlreplace %}
{% load i18n %}
{% load static %}
{% load thumb %}
@@ -44,7 +45,7 @@
<nav class="locales" aria-label="{% trans "select language" %}">
<ul>
{% for l in languages %}
<li><a href="{% url "presale:locale.set" %}?locale={{ l.code }}&next={{ request.path }}{% if request.META.QUERY_STRING %}%3F{{ request.META.QUERY_STRING|urlencode }}{% endif %}" class="{% if l.code == request.LANGUAGE_CODE %}active{% endif %}" rel="nofollow" lang="{{ l.code }}" hreflang="{{ l.code }}"
<li><a href="{% url "presale:locale.set" %}?locale={{ l.code }}&next={{ request.path }}{% if request.META.QUERY_STRING %}%3F{% url_replace request "locale" "" %}{% endif %}" class="{% if l.code == request.LANGUAGE_CODE %}active{% endif %}" rel="nofollow" lang="{{ l.code }}" hreflang="{{ l.code }}"
aria-label="{% language l.code %}{% blocktrans trimmed with language=l.name_local %}
Website in {{ language }}
{% endblocktrans %}{% endlanguage %}">{{ l.name_local }}</a></li>

View File

@@ -1,4 +1,5 @@
{% extends "pretixpresale/base.html" %}
{% load urlreplace %}
{% load i18n %}
{% load static %}
{% load thumb %}
@@ -26,7 +27,7 @@
{% if organizer.settings.locales|length > 1 %}
<nav class="locales" aria-label="{% trans "select language" %}">
{% for l in languages %}
<a href="{% url "presale:locale.set" %}?locale={{ l.code }}&next={{ request.path }}%3F{{ request.META.QUERY_STRING|urlencode }}" class="{% if l.code == request.LANGUAGE_CODE %}active{% endif %}" rel="nofollow"
<a href="{% url "presale:locale.set" %}?locale={{ l.code }}&next={{ request.path }}{% if request.META.QUERY_STRING %}%3F{% url_replace request "locale" "" %}{% endif %}" class="{% if l.code == request.LANGUAGE_CODE %}active{% endif %}" rel="nofollow"
lang="{{ l.code }}" hreflang="{{ l.code }}"
aria-label="{% language l.code %}{% blocktrans trimmed with language=l.name_local %}
Website in {{ language }}