From 134d4131dbbc310716ec85b436a3edc2d004150c Mon Sep 17 00:00:00 2001 From: jultty Date: Tue, 20 Aug 2024 04:32:32 -0300 Subject: [PATCH] Fix slashes and home URL resolution in language toggle --- templates/base.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/base.html b/templates/base.html index abc246a..d6e871f 100644 --- a/templates/base.html +++ b/templates/base.html @@ -49,7 +49,7 @@ {% else %} {%- set locale_all_content = "All content" %} {%- set locale_language_name = "English" %} - {%- endif %} + {%- endif -%} @@ -81,13 +81,14 @@ {% if current_path and translation_count > 1 %} - {%- set english_path = current_path | regex_replace(pattern="^/pt", rep="") %} + {%- set slashless_current_path = current_path | regex_replace(pattern="^\/", rep="") %} + {%- set english_path = current_path | regex_replace(pattern="pt\/", rep="") %}
{% if lang ==
- {%- if lang == "pt" %}EN{% else %}PT + {%- if lang == "pt" %}EN{% else %}PT {%- endif %}
{%- endif %}