From dab53a1ef28ecc281d574b50d3433e806db375cd Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sun, 2 Aug 2026 14:31:50 +0200 Subject: Keep the compared translation independent of the interface language --- app/views/layouts/_nav_controls.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/views/layouts') diff --git a/app/views/layouts/_nav_controls.html.erb b/app/views/layouts/_nav_controls.html.erb index bae1082b..70d5130c 100644 --- a/app/views/layouts/_nav_controls.html.erb +++ b/app/views/layouts/_nav_controls.html.erb @@ -9,7 +9,8 @@ <% end %> - <%= link_to url_for(locale: (:en unless I18n.locale == :en)), + <% locale_target = request.query_parameters.symbolize_keys.except(:controller, :action, :only_path, :host, :port, :protocol, :anchor, :script_name).merge(:locale => (:en unless I18n.locale == :en)) %> + <%= link_to url_for(locale_target), class: "nav_toggle nav_locale", "aria-label" => t(".switch_locale"), title: t(".switch_locale") do %> <%= I18n.locale == :en ? "DE" : "EN" %> -- cgit v1.3