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 <igor@milhit.ch>
iGor milhit 2022-11-14 18:21:38 +01:00
parent 282b6bcd85
commit 465b42467d
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]
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"

View File

@ -3,10 +3,12 @@
<header>
<h2>{{.Title}}</h2>
</header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
<!-- "{{.Content}}" pulls from the markdown content of the corresponding
_index.md -->
{{.Content}}
<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 }}
<article>
<a href="{{.Permalink}}">{{.Title}}</a>

View File

@ -2,12 +2,18 @@
<header>
<h2>{{.Title}}</h2>
</header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
<!-- "{{.Content}}" pulls from the markdown content of the corresponding
_index.md -->
<article>
<header>
{{.Content }}
</header>
<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 }}
<article>
<a href="{{ .Permalink }}">

View File

@ -2,7 +2,7 @@
<header class="post-header">
<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
page.
-->

View File

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

View File

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

View File

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