Localize "By" (#530)

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

Fixes #528
This commit is contained in:
Regis Philibert 2022-04-07 13:34:56 -04:00 committed by GitHub
parent c3f177ebd4
commit 8915e56e6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 31 additions and 7 deletions

View file

@ -10,6 +10,9 @@ other = "Neuste {{.Title }}"
[readMore] [readMore]
other = "weiterlesen" other = "weiterlesen"
[by]
other = "Von"
[whatsInThis] [whatsInThis]
other = "Was ist in dieser {{ .Type }}" other = "Was ist in dieser {{ .Type }}"

View file

@ -10,6 +10,9 @@ other = "Recent {{.Title }}"
[readMore] [readMore]
other = "read more" other = "read more"
[by]
other = "By"
[whatsInThis] [whatsInThis]
other = "What's in this {{ .Type }}" other = "What's in this {{ .Type }}"

View file

@ -10,6 +10,9 @@ other = "{{.Title }} recientes"
[readMore] [readMore]
other = "Leer más" other = "Leer más"
[by]
other = "Por"
[whatsInThis] [whatsInThis]
other = "Qué hay en este {{ .Type }}" other = "Qué hay en este {{ .Type }}"

View file

@ -10,6 +10,9 @@ other = "{{.Title }} récents"
[readMore] [readMore]
other = "lire plus" other = "lire plus"
[by]
other = "Par"
[whatsInThis] [whatsInThis]
other = "Ce qui est dans {{ .Type }}" other = "Ce qui est dans {{ .Type }}"

View file

@ -10,6 +10,9 @@ other = "Recenti {{.Title }}"
[readMore] [readMore]
other = "leggi di più" other = "leggi di più"
[by]
other = "Da"
[whatsInThis] [whatsInThis]
other = "Cosa c'è in {{ .Type }}" other = "Cosa c'è in {{ .Type }}"

View file

@ -10,6 +10,9 @@ other = "Nyeste {{.Title }}"
[readMore] [readMore]
other = "Les mer" other = "Les mer"
[by]
other = "Av"
[whatsInThis] [whatsInThis]
other = "Innhold av {{ .Type }}" other = "Innhold av {{ .Type }}"

View file

@ -10,6 +10,9 @@ other = "{{.Title }} Recentes"
[readMore] [readMore]
other = "Leia mais" other = "Leia mais"
[by]
other = "por"
[whatsInThis] [whatsInThis]
other = "O que há neste {{ .Type }}" other = "O que há neste {{ .Type }}"

3
layouts/_default/by.html Normal file
View file

@ -0,0 +1,3 @@
{{- if eq .Lang "de" "en" "es" "fr" "it" "no" "pt" -}}
{{- i18n "by" -}}
{{ end -}}

View file

@ -20,12 +20,12 @@
</h1> </h1>
{{ with .Params.author | default .Site.Params.author }} {{ with .Params.author | default .Site.Params.author }}
<p class="tracked"> <p class="tracked">
By <strong> {{ $.Render "by" }} <strong>
{{ if reflect.IsSlice . }} {{- if reflect.IsSlice . -}}
{{ delimit . ", " | markdownify }} {{ delimit . ", " | markdownify }}
{{else}} {{- else -}}
{{ . | markdownify }} {{ . | markdownify }}
{{ end }} {{- end -}}
</strong> </strong>
</p> </p>
{{ end }} {{ end }}