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.

Co-Authored-by: iGor milhit <igor@milhit.ch>
iGor milhit 2022-11-14 18:21:38 +01:00
parent 282b6bcd85
commit 43b829f078
Signed by: igor
GPG Key ID: 692D97C3D0228A99
8 changed files with 51 additions and 26 deletions

10
i18n/en.toml 100644
View File

@ -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"

View File

@ -1,14 +1,8 @@
[lastCommit] address = "Adresse"
other = "Dernier commit modifiant cette page" contactsPriv = "Contacts personnels"
contactsPro = "Contacts professionnels"
[post-infos] defaultImageAlt = "Portrait de mouton en nuances de gris"
other = "Informations sur le billet" e-mail = "e-mail"
lastCommit = "Dernier commit modifiant cette page"
[permalink] permalink = "Permalien"
other = "Permalien" post-infos = "Informations sur le billet"
[contactsPriv]
other = "Contacts personnels"
[contactsPro]
other = "Contacts professionnels"

View File

@ -3,10 +3,12 @@
<header> <header>
<h2>{{.Title}}</h2> <h2>{{.Title}}</h2>
</header> </header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md --> <!-- "{{.Content}}" pulls from the markdown content of the corresponding
_index.md -->
{{.Content}} {{.Content}}
<article class="posts-list"> <article class="posts-list">
<!-- Ranges through content/posts/*.md --> <!-- Ranges through content/posts/*.md in reverse order, then displays
the post title, the date and categories (list-footer template) -->
{{ range .Pages.ByPublishDate.Reverse }} {{ range .Pages.ByPublishDate.Reverse }}
<article> <article>
<a href="{{.Permalink}}">{{.Title}}</a> <a href="{{.Permalink}}">{{.Title}}</a>

View File

@ -2,12 +2,18 @@
<header> <header>
<h2>{{.Title}}</h2> <h2>{{.Title}}</h2>
</header> </header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md --> <!-- "{{.Content}}" pulls from the markdown content of the corresponding
_index.md -->
<article> <article>
<header> <header>
{{.Content }} {{.Content }}
</header> </header>
<article class="posts-list"> <article class="posts-list">
<!--
Ranges pages by the publish date, in reverse order, to display the
post titles of the section from most recent to older. It adds to
the title the date and categories (from lists-footer.html)
-->
{{ range .Pages.ByPublishDate.Reverse }} {{ range .Pages.ByPublishDate.Reverse }}
<article> <article>
<a href="{{ .Permalink }}"> <a href="{{ .Permalink }}">

View File

@ -2,7 +2,7 @@
<header class="post-header"> <header class="post-header">
<h1 id="title">{{ .Title }}</h1> <h1 id="title">{{ .Title }}</h1>
<!-- <!--
If it's a static page, then the post information are useless and If it's a static page, then the post information is useless and
therefore not displayed. The test checks if the page IS NOT a static therefore not displayed. The test checks if the page IS NOT a static
page. page.
--> -->

View File

@ -2,12 +2,17 @@
<header> <header>
<h2>{{.Title}}</h2> <h2>{{.Title}}</h2>
</header> </header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md --> <!-- "{{.Content}}" pulls from the markdown content of the corresponding
_index.md -->
{{.Content}} {{.Content}}
<article class="terms"> <article class="terms">
<!-- Ranges throught categories, alphabetically, then displays the posts
title with the number of item in the category -->
{{ range .Data.Terms.Alphabetical }} {{ range .Data.Terms.Alphabetical }}
<article class="term"> <article class="term">
<p><a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> ({{ .Count }})</p> <p>
<a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> ({{ .Count }})
</p>
</article> </article>
{{ end }} {{ end }}
</article> </article>

View File

@ -14,7 +14,7 @@
{{- else if .Site.Params.ImageDescription -}} {{- else if .Site.Params.ImageDescription -}}
<meta property="og:image:alt" content="{{ .Site.Params.ImageDescription }}"> <meta property="og:image:alt" content="{{ .Site.Params.ImageDescription }}">
{{- else -}} {{- else -}}
<meta property="og:image:alt" content="Grayish sheep portrait"> <meta property="og:image:alt" content="{{ i18n "defaultImageAlt" }}">
{{ end }} {{ end }}
<meta property="og:locale" content="{{ .Language.Lang }}"> <meta property="og:locale" content="{{ .Language.Lang }}">
{{- if .IsNode }} {{- if .IsNode }}

View File

@ -1,20 +1,28 @@
<h2 id="contactsPro">{{ i18n "contactsPro" }}</h2> <h2 id="contactsPro">{{ i18n "contactsPro" }}</h2>
<dl class="home-lists"> <dl class="home-lists">
{{ with .Site.Params.contactsPro.email }} {{ with .Site.Params.contactsPro.email }}
<dt>e-mail</dt> <dt>{{ i18n "e-mail" }}</dt>
<dd><a href="mailto:{{ . }}" itemprop="email">{{ . }}</a></dt> <dd><a href="mailto:{{ . }}" itemprop="email">{{ . }}</a></dt>
{{end}} {{end}}
{{ with .Site.Params.contactsPro.address }} {{ with .Site.Params.contactsPro.address }}
<dt>Adresse</dt> <dt>{{ i18n "address" }}</dt>
<dd><span itemprop="address">{{ . }}</span></dd> <dd><span itemprop="address">{{ . }}</span></dd>
{{end}} {{end}}
{{ with .Site.Params.contactsPro.mobile}} {{ with .Site.Params.contactsPro.mobile}}
<dt>Mobile</dt> <dt>{{ i18n "mobile" }}</dt>
<dd><a href="tel:{{ replace . " " ""}}"><span itemprop="telephone">{{ . }}</span></a></dd> <dd>
<a href="tel:{{ replace . " " ""}}">
<span itemprop="telephone">{{ . }}</span>
</a>
</dd>
{{end}} {{end}}
{{ with .Site.Params.contactsPro.phone}} {{ with .Site.Params.contactsPro.phone}}
<dt>Tél.</dt> <dt>Tél.</dt>
<dd><a href="tel:{{ replace . " " ""}}"><span itemprop="telephone">{{ . }}</span></a></dd> <dd>
<a href="tel:{{ replace . " " ""}}">
<span itemprop="telephone">{{ . }}</span>
</a>
</dd>
{{end}} {{end}}
{{ with .Site.Params.contactsPro.publickey }} {{ with .Site.Params.contactsPro.publickey }}
<dt>Clé publique</dt> <dt>Clé publique</dt>