From 2e0cade651a070f0f770134d8c6a6d7cd6fff3f4 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 | 19 +++++++++++++++++++ i18n/fr.toml | 33 +++++++++++++++++++-------------- layouts/_default/list.html | 6 ++++-- layouts/_default/section.html | 8 +++++++- layouts/_default/single.html | 2 +- layouts/_default/terms.html | 9 +++++++-- layouts/partials/header.html | 9 ++++++--- layouts/partials/metadata.html | 2 +- layouts/partials/online.html | 2 +- layouts/partials/perso.html | 28 ++++++++++++++++++---------- layouts/partials/pro.html | 24 ++++++++++++++++-------- 11 files changed, 99 insertions(+), 43 deletions(-) create mode 100644 i18n/en.toml diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..983c619 --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,19 @@ +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" +online = "Online" +permalink = "Permalink" +post-infos = "Post information" +pubkey = "Public key" +subscribe = "Subscribe" +subscribeToPublications = "Subscribe to posts" +tel = "Phone" +toSection = "from this section" +toWebsite = "from the website" +xmpp = "xmpp" diff --git a/i18n/fr.toml b/i18n/fr.toml index d2500d4..8bf7512 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -1,14 +1,19 @@ -[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" +online = "En ligne" +permalink = "Permalien" +post-infos = "Informations sur le billet" +pubkey = "Clé publique" +subscribe = "S'abonner" +subscribeToPublications = "S'abonner aux publications" +tel = "Téléphone" +toSection = "de cette section" +toWebsite = "du site" +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/header.html b/layouts/partials/header.html index dc45039..a5e663d 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -16,17 +16,20 @@ {{ if .IsPage -}} S'abonner + title="{{ i18n "subscribeToPublications" }} {{ i18n "toWebsite" }}"> + {{ i18n "subscribe" }} {{ else if .IsHome -}} S'abonner + title="{{ i18n "subscribeToPublications" }} {{ i18n "toWebsite" }}"> + {{ i18n "subscribe" }} {{ else if .IsNode -}} S'abonner + title="{{ i18n "subscribeToPublications" }} {{ i18n "toSection" }}"> + {{ i18n "subscribe" }} {{ end -}} 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/online.html b/layouts/partials/online.html index f93e1cb..f60555f 100644 --- a/layouts/partials/online.html +++ b/layouts/partials/online.html @@ -1,4 +1,4 @@ -

Online

+

{{ i18n "online" }}

{{ with .Site.Params.online.git }}
Git
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}}