i18n: find translations #804

This commit is contained in:
Sören Weber 2024-03-16 21:47:29 +01:00
parent 628d6070c0
commit 567b930220
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -73,11 +73,11 @@
<span>&nbsp;</span> <span>&nbsp;</span>
<div class="control-style"> <div class="control-style">
<label class="a11y-only" for="R-select-language">{{ T "Language" }}</label> <label class="a11y-only" for="R-select-language">{{ T "Language" }}</label>
<select id="R-select-language" onchange="location = window.relearn.baseUri + this.value;"> <select id="R-select-language" onchange="location = this.querySelector( this.value ).dataset.url;">
{{- $page := .Page }} {{- $page := .Page }}
{{- $pageLang := .Page.Language.Lang }} {{- $pageLang := .Page.Language.Lang }}
{{- range .Page.AllTranslations }} {{- range .Page.AllTranslations }}
<option id="R-{{ .Language.Lang }}" value="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "basename" $basename) }}" lang="{{ .Language.LanguageCode }}"{{ if eq $pageLang .Language.Lang }} selected{{ end }}>{{ .Language.LanguageName }}</option> <option id="R-select-language-{{ .Language.Lang }}" value="#R-select-language-{{ .Language.Lang }}" data-url="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "basename" $basename) }}" lang="{{ .Language.LanguageCode }}"{{ if eq $pageLang .Language.Lang }} selected{{ end }}>{{ .Language.LanguageName }}</option>
{{- end }} {{- end }}
</select> </select>
</div> </div>
@ -94,7 +94,7 @@
{{- $firstvariant := true }} {{- $firstvariant := true }}
{{- range $themevariants }} {{- range $themevariants }}
{{- $themevariant := . }} {{- $themevariant := . }}
<option id="R-{{ $themevariant.identifier }}" value="{{ $themevariant.identifier }}"{{- if $firstvariant }} selected{{ end }}>{{ $themevariant.name }}</option> <option id="R-select-variant-{{ $themevariant.identifier }}" value="{{ $themevariant.identifier }}"{{- if $firstvariant }} selected{{ end }}>{{ $themevariant.name }}</option>
{{- $firstvariant = false }} {{- $firstvariant = false }}
{{- end }} {{- end }}
</select> </select>