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 d2a7e22e58
Signed by: igor
GPG Key ID: 692D97C3D0228A99
9 changed files with 82 additions and 39 deletions

14
i18n/en.toml 100644
View File

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

View File

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

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,35 +1,43 @@
<h2 id="contactsPriv">{{ i18n "contactsPriv" }}</h2>
<dl class="home-lists">
{{ with .Site.Params.contactsPriv.email }}
<dt>e-mail</dt>
<dt>{{ i18n "e-mail" }}</dt>
<dd><a href="mailto:{{ . }}" itemprop="email">{{ . }}</a></dd>
{{ end }}
{{ with .Site.Params.contactsPriv.address }}
<dt>Adresse</dt>
<dt>{{ i18n "address" }}</dt>
<dd><span itemprop="address">{{ . }}</span></dd>
{{ end }}
{{ with .Site.Params.contactsPriv.phone }}
<dt>Tél.</dt>
<dd><a href="tel:{{ replace . " " ""}}"><span itemprop="telephone">{{ . }}</span></a></dd>
<dt>{{ i18n "tel" }}</dt>
<dd>
<a href="tel:{{ replace . " " ""}}">
<span itemprop="telephone">{{ . }}</span>
</a>
</dd>
{{end}}
{{ with .Site.Params.contactsPriv.mobile }}
<dt>Tél. 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.contactsPriv.publickey }}
<dt>Clé publique</dt>
<dt>{{ i18n "pubkey" }}</dt>
<dd><a href="/{{ . }}">{{ . }}</a></dd>
{{ end }}
{{ with .Site.Params.contactsPriv.fingerprint }}
<dt>Empreinte</dt>
<dt>{{ i18n "fingerprint" }}</dt>
<dd><code>{{ . }}</code></dd>
{{ end }}
{{ with .Site.Params.contactsPriv.xmpp }}
<dt>XMPP/jabber</dt>
<dt class="smallcaps">{{ i18n "xmpp" }}</dt>
<dd>{{ . }}</dd>
{{ end }}
{{ with .Site.Params.contactsPriv.cv}}
<dt>CV</dt>
<dt class="smallcaps">{{ i18n "cv" }}</dt>
<dd><a href="/{{ . }}">{{ . }}</a></dd>
{{end}}
</dl>

View File

@ -1,27 +1,35 @@
<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>
<dt>{{ i18n "tel" }}</dt>
<dd>
<a href="tel:{{ replace . " " ""}}">
<span itemprop="telephone">{{ . }}</span>
</a>
</dd>
{{end}}
{{ with .Site.Params.contactsPro.publickey }}
<dt>Clé publique</dt>
<dt>{{ i18n "pubkey" }}</dt>
<dd><a href="/{{ . }}">{{ . }}</a></dd>
{{end}}
{{ with .Site.Params.contactsPro.fingerprint}}
<dt>Empreinte</dt>
<dt>{{ i18n "fingerprint" }}</dt>
<dd><code>{{ . }}</code></dd>
{{end}}
</dl>