diff options
author | Regis Philibert <login@regisphilibert.com> | 2022-04-07 20:34:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 20:34:56 +0300 |
commit | 8915e56e6e08ca34b37f3bbb2f8ae15a7fb43b17 (patch) | |
tree | 2e927a4be6a5965a478fcc82e85358df0b2e2a88 | |
parent | c3f177ebd4a10ddd4568564a59a0994bef5bead5 (diff) |
Localize "By" (#530)
* Localize "By" for some languages (En/De/Es/Fr/It/Pt/No) and wrap string in a dedicated template.
Fixes #528
-rw-r--r-- | i18n/de.toml | 3 | ||||
-rw-r--r-- | i18n/en.toml | 3 | ||||
-rw-r--r-- | i18n/es.toml | 3 | ||||
-rw-r--r-- | i18n/fr.toml | 3 | ||||
-rw-r--r-- | i18n/it.toml | 3 | ||||
-rw-r--r-- | i18n/no.toml | 3 | ||||
-rw-r--r-- | i18n/pt.toml | 3 | ||||
-rw-r--r-- | layouts/_default/by.html | 3 | ||||
-rwxr-xr-x | layouts/_default/single.html | 14 |
9 files changed, 31 insertions, 7 deletions
diff --git a/i18n/de.toml b/i18n/de.toml index 1109b97..c0b4f10 100644 --- a/i18n/de.toml +++ b/i18n/de.toml @@ -10,6 +10,9 @@ other = "Neuste {{.Title }}" [readMore] other = "weiterlesen" +[by] +other = "Von" + [whatsInThis] other = "Was ist in dieser {{ .Type }}" diff --git a/i18n/en.toml b/i18n/en.toml index 755e3b0..4e5638d 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -10,6 +10,9 @@ other = "Recent {{.Title }}" [readMore] other = "read more" +[by] +other = "By" + [whatsInThis] other = "What's in this {{ .Type }}" diff --git a/i18n/es.toml b/i18n/es.toml index ed7c31f..e5d61b1 100644 --- a/i18n/es.toml +++ b/i18n/es.toml @@ -10,6 +10,9 @@ other = "{{.Title }} recientes" [readMore] other = "Leer más" +[by] +other = "Por" + [whatsInThis] other = "Qué hay en este {{ .Type }}" diff --git a/i18n/fr.toml b/i18n/fr.toml index fb7d42b..47d20aa 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -10,6 +10,9 @@ other = "{{.Title }} récents" [readMore] other = "lire plus" +[by] +other = "Par" + [whatsInThis] other = "Ce qui est dans {{ .Type }}" diff --git a/i18n/it.toml b/i18n/it.toml index 417f4ac..51b96c4 100644 --- a/i18n/it.toml +++ b/i18n/it.toml @@ -10,6 +10,9 @@ other = "Recenti {{.Title }}" [readMore] other = "leggi di più" +[by] +other = "Da" + [whatsInThis] other = "Cosa c'è in {{ .Type }}" diff --git a/i18n/no.toml b/i18n/no.toml index d6165f6..40b2aca 100644 --- a/i18n/no.toml +++ b/i18n/no.toml @@ -10,6 +10,9 @@ other = "Nyeste {{.Title }}" [readMore] other = "Les mer" +[by] +other = "Av" + [whatsInThis] other = "Innhold av {{ .Type }}" diff --git a/i18n/pt.toml b/i18n/pt.toml index 024cd42..2e45736 100644 --- a/i18n/pt.toml +++ b/i18n/pt.toml @@ -10,6 +10,9 @@ other = "{{.Title }} Recentes" [readMore] other = "Leia mais" +[by] +other = "por" + [whatsInThis] other = "O que há neste {{ .Type }}" diff --git a/layouts/_default/by.html b/layouts/_default/by.html new file mode 100644 index 0000000..2170065 --- /dev/null +++ b/layouts/_default/by.html @@ -0,0 +1,3 @@ +{{- if eq .Lang "de" "en" "es" "fr" "it" "no" "pt" -}} +{{- i18n "by" -}} +{{ end -}}
\ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index aa871f0..a40a4c5 100755 --- a/layouts/_default/single.html +++ b/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 */}} |