From a12f6316d5539aece50544a41e4e06125073bf5f Mon Sep 17 00:00:00 2001 From: anarsec Date: Thu, 21 Nov 2024 14:25:11 -0500 Subject: [PATCH] more french --- config.toml | 46 ++++++++++++++++--- content/_index.fr.md | 2 +- content/glossary/_index.fr.md | 2 +- content/series/_index.fr.md | 2 +- themes/DeepThought/sass/deep-thought.sass | 6 +++ themes/DeepThought/templates/base.html | 1 + .../templates/categories/list.html | 7 ++- .../templates/categories/single.html | 4 +- themes/DeepThought/templates/macros.html | 18 +++++--- themes/DeepThought/templates/page.html | 2 +- .../templates/partials/language_switcher.html | 34 ++++++++++++++ themes/DeepThought/templates/section.html | 2 +- themes/DeepThought/templates/tags/list.html | 5 +- themes/DeepThought/templates/tags/single.html | 4 +- 14 files changed, 108 insertions(+), 27 deletions(-) create mode 100644 themes/DeepThought/templates/partials/language_switcher.html diff --git a/config.toml b/config.toml index f3d5abf..bafdc0e 100644 --- a/config.toml +++ b/config.toml @@ -17,6 +17,31 @@ smart_punctuation = false [link_checker] internal_level = "error" +[translations] +language_name = "en" +language_selection = "Language" +published = "Published on" +edited = "Last edited on" +letter = "Letter booklet" +a4 = "A4 booklet" +read = "Read More" +contents = "Contents" +categories = "Categories" +defensive = "Defensive" +offensive = "Offensive" +tags = "Tags" +beginner = "beginner" +e2ee = "e2ee" +intermediate = "intermediate" +intro = "intro" +linux = "linux" +metadata = "metadata" +mobile = "mobile" +opsec = "opsec" +qubes = "qubes" +tails = "tails" +windows = "windows" + [languages.fr] generate_feeds = true taxonomies = [ @@ -26,10 +51,19 @@ taxonomies = [ title = "AnarSec" [languages.fr.translations] -letter = "Letter zine" - -[translations] -letter = "Letter booklet" +language_name = "fr" +language_selection = "Langue" +published = "Publié le" +edited = "Modifié le" +letter = "Brochure Letter" +a4 = "Brochure A4" +read = "Lire la suite" +contents = "Sommaire" +categories = "Catégories" +defensive = "Défensif" +offensive = "Offensif" +tags = "Tags" +mobile = "téléphonie" [extra] navbar_items = [ @@ -42,9 +76,9 @@ navbar_items = [ ] }, { code = "fr", nav_items = [ { url = "$BASE_URL/fr/posts/", name = "Guides" }, - { url = "$BASE_URL/fr/series/", name = "Series" }, + { url = "$BASE_URL/fr/series/", name = "Séries" }, { url = "$BASE_URL/fr/recommendations/", name = "Recommendations" }, - { url = "$BASE_URL/fr/glossary/", name = "Glossary" }, + { url = "$BASE_URL/fr/glossary/", name = "Glossaire" }, { url = "$BASE_URL/fr/contact/", name = "Contact" }, ] } ] diff --git a/content/_index.fr.md b/content/_index.fr.md index b93aec0..92be288 100644 --- a/content/_index.fr.md +++ b/content/_index.fr.md @@ -1,7 +1,7 @@ +++ sort_by = "date" paginate_by = 10 -title = "Tech Guides for Anarchists" +title = "Guides numériques pour anarchistes" +++

diff --git a/content/glossary/_index.fr.md b/content/glossary/_index.fr.md index a6ab73e..6d004cb 100644 --- a/content/glossary/_index.fr.md +++ b/content/glossary/_index.fr.md @@ -1,5 +1,5 @@ +++ -title = "Glossary" +title = "Glossaire" sort_by = "date" paginate_by = 5 +++ diff --git a/content/series/_index.fr.md b/content/series/_index.fr.md index 7d94894..bb590ec 100644 --- a/content/series/_index.fr.md +++ b/content/series/_index.fr.md @@ -1,5 +1,5 @@ +++ -title = "Series" +title = "Séries" description = "" sort_by = "date" paginate_by = 5 diff --git a/themes/DeepThought/sass/deep-thought.sass b/themes/DeepThought/sass/deep-thought.sass index ea634d3..d83847b 100644 --- a/themes/DeepThought/sass/deep-thought.sass +++ b/themes/DeepThought/sass/deep-thought.sass @@ -582,6 +582,12 @@ a .menu-list a.is-active background-color: #AE3B8B +li.lang-switcher + list-style: none + +summary + list-style: none + code color: #AE3B8B diff --git a/themes/DeepThought/templates/base.html b/themes/DeepThought/templates/base.html index 66c557c..748f878 100644 --- a/themes/DeepThought/templates/base.html +++ b/themes/DeepThought/templates/base.html @@ -62,6 +62,7 @@ {% endfor %} {% endif %} {% endfor %} + {% include "partials/language_switcher.html" %} diff --git a/themes/DeepThought/templates/categories/list.html b/themes/DeepThought/templates/categories/list.html index 42bc4e6..0367668 100644 --- a/themes/DeepThought/templates/categories/list.html +++ b/themes/DeepThought/templates/categories/list.html @@ -8,16 +8,15 @@ - Categories + {{ trans(key="categories", lang=lang) }} -

{{ terms | length }} categories in total

{% for category in terms %} - + - {{category.name}} {{ category.pages | length }} + {{ trans(key=category.name | lower, lang=lang) }} {{ category.pages | length }} {% endfor %}

diff --git a/themes/DeepThought/templates/categories/single.html b/themes/DeepThought/templates/categories/single.html index 3671b7e..5d4c0e0 100644 --- a/themes/DeepThought/templates/categories/single.html +++ b/themes/DeepThought/templates/categories/single.html @@ -10,7 +10,9 @@ - {{ term.name }} + + {{ trans(key=term.name| lower, lang=lang) }} + diff --git a/themes/DeepThought/templates/macros.html b/themes/DeepThought/templates/macros.html index 8e31c59..09a31c6 100644 --- a/themes/DeepThought/templates/macros.html +++ b/themes/DeepThought/templates/macros.html @@ -56,9 +56,9 @@ - Published on  + {{ trans(key="published", lang=lang) }}  -  | Last edited on  +  | {{ trans(key="edited", lang=lang) }}  {% endmacro %} @@ -76,20 +76,22 @@ - Letter booklet | A4 booklet + {{ trans(key="letter", lang=lang) }} | {{ trans(key="a4", lang=lang) }} {% endmacro %} {% macro render_categories(categories) %}

- Categories: + {{ trans(key="categories", lang=lang) }}: {% for category in categories %} - {{category}} + + {{ trans(key=category | lower, lang=lang) }} + {% endfor %} @@ -98,14 +100,16 @@ {% macro render_tags(tags) %}

- Tags: + {{ trans(key="tags", lang=lang) }}: {% for tag in tags %} - {{tag}} + + {{ trans(key=tag, lang=lang) }} + {% endfor %} diff --git a/themes/DeepThought/templates/page.html b/themes/DeepThought/templates/page.html index 4625e3a..0db3ad3 100644 --- a/themes/DeepThought/templates/page.html +++ b/themes/DeepThought/templates/page.html @@ -45,7 +45,7 @@ {% if page.extra.toc %}