mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
i18n: find translations #804
This commit is contained in:
parent
628d6070c0
commit
567b930220
1 changed files with 3 additions and 3 deletions
|
@ -73,11 +73,11 @@
|
||||||
<span> </span>
|
<span> </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>
|
||||||
|
|
Loading…
Reference in a new issue