Refonte de la navigation en français et amélioration de la redirection linguistique

This commit is contained in:
Boris Waaub
2026-01-19 16:52:36 +01:00
parent 7b724fb001
commit 2fce96f794
3 changed files with 85 additions and 72 deletions
@@ -7,7 +7,11 @@
{{ $pageLink := replace (replace $context.RelPermalink (add $pageLang "/") "") $base.Path "/" }}
{{ if $context.IsTranslated }}
<select class="{{ $class }} lang-select" onchange="location = this.value">
<select class="{{ $class }} lang-select" onchange="(function(sel){
var lang = sel.value.split('/')[1];
localStorage.setItem('preferredLang', lang);
location = sel.value;
})(this)">
{{ range $siteLanguages }}
{{ if eq (string $pageLang) (string .Language) }}
<option