From 8915e56e6e08ca34b37f3bbb2f8ae15a7fb43b17 Mon Sep 17 00:00:00 2001
From: Regis Philibert <login@regisphilibert.com>
Date: Thu, 07 Apr 2022 17:34:56 +0000
Subject: [PATCH] Localize "By" (#530)

---
 layouts/_default/by.html     |    3 +++
 layouts/_default/single.html |   14 +++++++-------
 i18n/en.toml                 |    3 +++
 i18n/es.toml                 |    3 +++
 i18n/it.toml                 |    3 +++
 i18n/fr.toml                 |    3 +++
 i18n/no.toml                 |    3 +++
 i18n/pt.toml                 |    3 +++
 i18n/de.toml                 |    3 +++
 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 @@
 [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 @@
 [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 @@
 [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 @@
 [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 @@
 [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 @@
 [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 @@
 [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 */}}

--
Gitblit v1.10.0