From 465b42467ddf238a184ffd28935898d694637049 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 | 10 ++++++++++ i18n/fr.toml | 22 ++++++++-------------- 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/pro.html | 18 +++++++++++++----- 8 files changed, 51 insertions(+), 26 deletions(-) create mode 100644 i18n/en.toml diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..25c57f1 --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,10 @@ +address = "Address" +contactsPriv = "Personal contacts" +contactsPro = "Professional contacts" +defaultImageAlt = "Grayish sheep portrait" +e-mail = "e-mail" +lastCommit = "Last commit modifying this page" +mobile = "Mobile" +permalink = "Permalink" +post-infos = "Post information" + diff --git a/i18n/fr.toml b/i18n/fr.toml index d2500d4..ff8094a 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -1,14 +1,8 @@ -[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" +defaultImageAlt = "Portrait de mouton en nuances de gris" +e-mail = "e-mail" +lastCommit = "Dernier commit modifiant cette page" +permalink = "Permalien" +post-infos = "Informations sur le billet" 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/pro.html b/layouts/partials/pro.html index b54142d..87a93b3 100644 --- a/layouts/partials/pro.html +++ b/layouts/partials/pro.html @@ -1,20 +1,28 @@

{{ 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.
-
{{ . }}
+
+ + {{ . }} + +
{{end}} {{ with .Site.Params.contactsPro.publickey }}
Clé publique