mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Regis Philibert
07.34.2022 8915e56e6e08ca34b37f3bbb2f8ae15a7fb43b17
Localize "By" (#530)

* Localize "By" for some languages (En/De/Es/Fr/It/Pt/No) and wrap string in a dedicated template.

Fixes #528
1 files added
8 files modified
38 ■■■■ changed files
i18n/de.toml 3 ●●●●● patch | view | raw | blame | history
i18n/en.toml 3 ●●●●● patch | view | raw | blame | history
i18n/es.toml 3 ●●●●● patch | view | raw | blame | history
i18n/fr.toml 3 ●●●●● patch | view | raw | blame | history
i18n/it.toml 3 ●●●●● patch | view | raw | blame | history
i18n/no.toml 3 ●●●●● patch | view | raw | blame | history
i18n/pt.toml 3 ●●●●● patch | view | raw | blame | history
layouts/_default/by.html 3 ●●●●● patch | view | raw | blame | history
layouts/_default/single.html 14 ●●●● patch | view | raw | blame | history
i18n/de.toml
@@ -10,6 +10,9 @@
[readMore]
other = "weiterlesen"
[by]
other = "Von"
[whatsInThis]
other = "Was ist in dieser {{ .Type }}"
i18n/en.toml
@@ -10,6 +10,9 @@
[readMore]
other = "read more"
[by]
other = "By"
[whatsInThis]
other = "What's in this {{ .Type }}"
i18n/es.toml
@@ -10,6 +10,9 @@
[readMore]
other = "Leer más"
[by]
other = "Por"
[whatsInThis]
other = "Qué hay en este {{ .Type }}"
i18n/fr.toml
@@ -10,6 +10,9 @@
[readMore]
other = "lire plus"
[by]
other = "Par"
[whatsInThis]
other = "Ce qui est dans {{ .Type }}"
i18n/it.toml
@@ -10,6 +10,9 @@
[readMore]
other = "leggi di più"
[by]
other = "Da"
[whatsInThis]
other = "Cosa c'è in {{ .Type }}"
i18n/no.toml
@@ -10,6 +10,9 @@
[readMore]
other = "Les mer"
[by]
other = "Av"
[whatsInThis]
other = "Innhold av {{ .Type }}"
i18n/pt.toml
@@ -10,6 +10,9 @@
[readMore]
other = "Leia mais"
[by]
other = "por"
[whatsInThis]
other = "O que há neste {{ .Type }}"
layouts/_default/by.html
New file
@@ -0,0 +1,3 @@
{{- if eq .Lang "de" "en" "es" "fr" "it" "no" "pt" -}}
{{- i18n "by" -}}
{{ end -}}
layouts/_default/single.html
@@ -20,13 +20,13 @@
      </h1>
      {{ with .Params.author | default .Site.Params.author }}
      <p class="tracked">
          By <strong>
          {{ if reflect.IsSlice . }}
              {{ delimit . ", " | markdownify }}
          {{else}}
              {{ . | markdownify }}
          {{ end }}
          </strong>
        {{ $.Render "by" }} <strong>
        {{- if reflect.IsSlice . -}}
            {{ delimit . ", " | markdownify }}
        {{- else -}}
            {{ . | markdownify }}
        {{- end -}}
        </strong>
      </p>
      {{ end }}
      {{/* Hugo uses Go's date formatting is set by example. Here are two formats */}}