From d2a7e22e589048b290e275b81881ffb2a138dd47 Mon Sep 17 00:00:00 2001 From: iGor milhit Date: Mon, 14 Nov 2022 18:21:38 +0100 Subject: [PATCH] i18n: extract, translate strings to be translated - Extracts stings to be translated. - Translates these strings in English and French. - Improves some comments in the templates. - Fixes #18. Co-Authored-by: iGor milhit --- i18n/en.toml | 14 ++++++++++++++ i18n/fr.toml | 28 ++++++++++++++-------------- layouts/_default/list.html | 6 ++++-- layouts/_default/section.html | 8 +++++++- layouts/_default/single.html | 2 +- layouts/_default/terms.html | 9 +++++++-- layouts/partials/metadata.html | 2 +- layouts/partials/perso.html | 28 ++++++++++++++++++---------- layouts/partials/pro.html | 24 ++++++++++++++++-------- 9 files changed, 82 insertions(+), 39 deletions(-) create mode 100644 i18n/en.toml diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..5dd703a --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,14 @@ +address = "Address" +contactsPriv = "Personal contacts" +contactsPro = "Professional contacts" +cv = "cv" +defaultImageAlt = "Grayish sheep portrait" +e-mail = "e-mail" +fingerprint = "Fingerprint" +lastCommit = "Last commit modifying this page" +mobile = "Mobile" +permalink = "Permalink" +post-infos = "Post information" +pubkey = "Public key" +tel = "Phone" +xmpp = "xmpp" diff --git a/i18n/fr.toml b/i18n/fr.toml index d2500d4..52b9fe9 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -1,14 +1,14 @@ -[lastCommit] -other = "Dernier commit modifiant cette page" - -[post-infos] -other = "Informations sur le billet" - -[permalink] -other = "Permalien" - -[contactsPriv] -other = "Contacts personnels" - -[contactsPro] -other = "Contacts professionnels" +address = "Adresse" +contactsPriv = "Contacts personnels" +contactsPro = "Contacts professionnels" +cv = "cv" +defaultImageAlt = "Portrait de mouton en nuances de gris" +e-mail = "e-mail" +fingerprint = "Empreinte" +lastCommit = "Dernier commit modifiant cette page" +mobile = "Téléphone mobile" +permalink = "Permalien" +post-infos = "Informations sur le billet" +pubkey = "Clé publique" +tel = "Téléphone" +xmpp = "xmpp" diff --git a/layouts/_default/list.html b/layouts/_default/list.html index f27475e..775ad82 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -3,10 +3,12 @@

{{.Title}}

- + {{.Content}}
- + {{ range .Pages.ByPublishDate.Reverse }}
{{.Title}} diff --git a/layouts/_default/section.html b/layouts/_default/section.html index 7b99c18..e1bc813 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -2,12 +2,18 @@

{{.Title}}

- +
{{.Content }}
+ {{ range .Pages.ByPublishDate.Reverse }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 3483a52..0b53320 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,7 +2,7 @@

{{ .Title }}

diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index b817b74..eb55187 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -2,12 +2,17 @@

{{.Title}}

- + {{.Content}}
diff --git a/layouts/partials/metadata.html b/layouts/partials/metadata.html index 5990b3a..5d5ca53 100644 --- a/layouts/partials/metadata.html +++ b/layouts/partials/metadata.html @@ -14,7 +14,7 @@ {{- else if .Site.Params.ImageDescription -}} {{- else -}} - + {{ end }} {{- if .IsNode }} diff --git a/layouts/partials/perso.html b/layouts/partials/perso.html index 10c8765..f4d227f 100644 --- a/layouts/partials/perso.html +++ b/layouts/partials/perso.html @@ -1,35 +1,43 @@

{{ i18n "contactsPriv" }}

{{ with .Site.Params.contactsPriv.email }} -
e-mail
+
{{ i18n "e-mail" }}
{{ . }}
{{ end }} {{ with .Site.Params.contactsPriv.address }} -
Adresse
+
{{ i18n "address" }}
{{ . }}
{{ end }} {{ with .Site.Params.contactsPriv.phone }} -
Tél.
-
{{ . }}
+
{{ i18n "tel" }}
+
+ + {{ . }} + +
{{end}} {{ with .Site.Params.contactsPriv.mobile }} -
Tél. mobile
-
{{ . }}
+
{{ i18n "mobile" }}
+
+ + {{ . }} + +
{{end}} {{ with .Site.Params.contactsPriv.publickey }} -
Clé publique
+
{{ i18n "pubkey" }}
{{ . }}
{{ end }} {{ with .Site.Params.contactsPriv.fingerprint }} -
Empreinte
+
{{ i18n "fingerprint" }}
{{ . }}
{{ end }} {{ with .Site.Params.contactsPriv.xmpp }} -
XMPP/jabber
+
{{ i18n "xmpp" }}
{{ . }}
{{ end }} {{ with .Site.Params.contactsPriv.cv}} -
CV
+
{{ i18n "cv" }}
{{ . }}
{{end}}
diff --git a/layouts/partials/pro.html b/layouts/partials/pro.html index b54142d..014ffc9 100644 --- a/layouts/partials/pro.html +++ b/layouts/partials/pro.html @@ -1,27 +1,35 @@

{{ i18n "contactsPro" }}

{{ with .Site.Params.contactsPro.email }} -
e-mail
+
{{ i18n "e-mail" }}
{{ . }} {{end}} {{ with .Site.Params.contactsPro.address }} -
Adresse
+
{{ i18n "address" }}
{{ . }}
{{end}} {{ with .Site.Params.contactsPro.mobile}} -
Mobile
-
{{ . }}
+
{{ i18n "mobile" }}
+
+ + {{ . }} + +
{{end}} {{ with .Site.Params.contactsPro.phone}} -
Tél.
-
{{ . }}
+
{{ i18n "tel" }}
+
+ + {{ . }} + +
{{end}} {{ with .Site.Params.contactsPro.publickey }} -
Clé publique
+
{{ i18n "pubkey" }}
{{ . }}
{{end}} {{ with .Site.Params.contactsPro.fingerprint}} -
Empreinte
+
{{ i18n "fingerprint" }}
{{ . }}
{{end}}