more french

This commit is contained in:
anarsec 2024-11-21 14:25:11 -05:00
parent 4cd55ea6ac
commit a12f6316d5
No known key found for this signature in database
14 changed files with 108 additions and 27 deletions

View file

@ -17,6 +17,31 @@ smart_punctuation = false
[link_checker] [link_checker]
internal_level = "error" 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] [languages.fr]
generate_feeds = true generate_feeds = true
taxonomies = [ taxonomies = [
@ -26,10 +51,19 @@ taxonomies = [
title = "AnarSec" title = "AnarSec"
[languages.fr.translations] [languages.fr.translations]
letter = "Letter zine" language_name = "fr"
language_selection = "Langue"
[translations] published = "Publié le"
letter = "Letter booklet" 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] [extra]
navbar_items = [ navbar_items = [
@ -42,9 +76,9 @@ navbar_items = [
] }, ] },
{ code = "fr", nav_items = [ { code = "fr", nav_items = [
{ url = "$BASE_URL/fr/posts/", name = "Guides" }, { 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/recommendations/", name = "Recommendations" },
{ url = "$BASE_URL/fr/glossary/", name = "Glossary" }, { url = "$BASE_URL/fr/glossary/", name = "Glossaire" },
{ url = "$BASE_URL/fr/contact/", name = "Contact" }, { url = "$BASE_URL/fr/contact/", name = "Contact" },
] } ] }
] ]

View file

@ -1,7 +1,7 @@
+++ +++
sort_by = "date" sort_by = "date"
paginate_by = 10 paginate_by = 10
title = "Tech Guides for Anarchists" title = "Guides numériques pour anarchistes"
+++ +++
<br> <br>
<br> <br>

View file

@ -1,5 +1,5 @@
+++ +++
title = "Glossary" title = "Glossaire"
sort_by = "date" sort_by = "date"
paginate_by = 5 paginate_by = 5
+++ +++

View file

@ -1,5 +1,5 @@
+++ +++
title = "Series" title = "Séries"
description = "" description = ""
sort_by = "date" sort_by = "date"
paginate_by = 5 paginate_by = 5

View file

@ -582,6 +582,12 @@ a
.menu-list a.is-active .menu-list a.is-active
background-color: #AE3B8B background-color: #AE3B8B
li.lang-switcher
list-style: none
summary
list-style: none
code code
color: #AE3B8B color: #AE3B8B

View file

@ -62,6 +62,7 @@
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% include "partials/language_switcher.html" %}
<a class="navbar-item" id="nav-search" title="Search" href="/search" target="_blank" rel="noopener noreferrer"> <a class="navbar-item" id="nav-search" title="Search" href="/search" target="_blank" rel="noopener noreferrer">
<span class="icon is-small"> <span class="icon is-small">
<img src="/images/search.png"> <img src="/images/search.png">

View file

@ -8,16 +8,15 @@
<span class="icon"> <span class="icon">
<img src="/images/cube.png"> <img src="/images/cube.png">
</span> </span>
Categories {{ trans(key="categories", lang=lang) }}
</h1> </h1>
<p class='subtitle is-4'>{{ terms | length }} categories in total</p>
<p> <p>
{% for category in terms %} {% for category in terms %}
<a href="/categories/{{category.name | lower}}" class="mr-4"> <a href="{{get_url(path="", lang=lang)}}/categories/{{category.name | lower}}" class="mr-4">
<span class="icon is-small"> <span class="icon is-small">
<img src="/images/cube.png"> <img src="/images/cube.png">
</span> </span>
<span>{{category.name}} <sup>{{ category.pages | length }}</sup></span> <span>{{ trans(key=category.name | lower, lang=lang) }} <sup>{{ category.pages | length }}</sup></span>
</a> </a>
{% endfor %} {% endfor %}
</p> </p>

View file

@ -10,7 +10,9 @@
<span class="icon is-small"> <span class="icon is-small">
<img src="/images/cube.png"> <img src="/images/cube.png">
</span> </span>
<span>{{ term.name }}</span> <span>
{{ trans(key=term.name| lower, lang=lang) }}
</span>
</span> </span>
</h1> </h1>
</div> </div>

View file

@ -56,9 +56,9 @@
<span class="icon is-small"> <span class="icon is-small">
<img src="/images/calendar-alt.png"> <img src="/images/calendar-alt.png">
</span> </span>
<span>Published on&nbsp;</span> <span>{{ trans(key="published", lang=lang) }}&nbsp;</span>
<span><time datetime="{{ page.date }}">{{ page.date | date(format='%B %d, %Y') }}</time></span> <span><time datetime="{{ page.date }}">{{ page.date | date(format='%B %d, %Y') }}</time></span>
<span>&nbsp;| <a href="https://0xacab.org/anarsec/anarsec.guide/-/blob/no-masters/CHANGELOG.md#{{page.title | slugify}}">Last edited on&nbsp;<time datetime="{{ page.extra.dateedit }}">{{ page.extra.dateedit | date(format='%B %d, %Y') }}</time></a></span> <span>&nbsp;| <a href="https://0xacab.org/anarsec/anarsec.guide/-/blob/no-masters/CHANGELOG.md#{{page.title | slugify}}">{{ trans(key="edited", lang=lang) }}&nbsp;<time datetime="{{ page.extra.dateedit }}">{{ page.extra.dateedit | date(format='%B %d, %Y') }}</time></a></span>
</span> </span>
{% endmacro %} {% endmacro %}
@ -76,20 +76,22 @@
<span class="icon is-small"> <span class="icon is-small">
<img src="/images/file-pdf.png"> <img src="/images/file-pdf.png">
</span> </span>
<span><a href="{{page.slug | lower}}/{{page.extra.letter | lower}}">Letter booklet</a> | <a href="{{page.slug | lower}}/{{page.extra.a4 | lower}}">A4 booklet</a> </span> <span><a href="{{page.slug | lower}}/{{page.extra.letter | lower}}">{{ trans(key="letter", lang=lang) }}</a> | <a href="{{page.slug | lower}}/{{page.extra.a4 | lower}}">{{ trans(key="a4", lang=lang) }}</a> </span>
</span> </span>
{% endmacro %} {% endmacro %}
{% macro render_categories(categories) %} {% macro render_categories(categories) %}
<p> <p>
Categories: {{ trans(key="categories", lang=lang) }}:
{% for category in categories %} {% for category in categories %}
<a class="has-text-weight-semibold" href="{{get_url(path="", lang=lang)}}/categories/{{category | lower}}"> <a class="has-text-weight-semibold" href="{{get_url(path="", lang=lang)}}/categories/{{category | lower}}">
<span class="icon-text"> <span class="icon-text">
<span class="icon is-small"> <span class="icon is-small">
<img src="/images/cube-pink.png"> <img src="/images/cube-pink.png">
</span> </span>
<span>{{category}}</span> <span>
{{ trans(key=category | lower, lang=lang) }}
</span>
</span> </span>
</a> </a>
{% endfor %} {% endfor %}
@ -98,14 +100,16 @@
{% macro render_tags(tags) %} {% macro render_tags(tags) %}
<p> <p>
Tags: {{ trans(key="tags", lang=lang) }}:
{% for tag in tags %} {% for tag in tags %}
<a class="has-text-weight-semibold" href="{{get_url(path="", lang=lang)}}/tags/{{tag | lower}}"> <a class="has-text-weight-semibold" href="{{get_url(path="", lang=lang)}}/tags/{{tag | lower}}">
<span class="icon-text"> <span class="icon-text">
<span class="icon is-small"> <span class="icon is-small">
<img src="/images/tag-pink.png"> <img src="/images/tag-pink.png">
</span> </span>
<span>{{tag}}</span> <span>
{{ trans(key=tag, lang=lang) }}
</span>
</span> </span>
</a> </a>
{% endfor %} {% endfor %}

View file

@ -45,7 +45,7 @@
{% if page.extra.toc %} {% if page.extra.toc %}
<div class="column is-2 is-hidden-mobile"> <div class="column is-2 is-hidden-mobile">
<aside class="menu"> <aside class="menu">
<p class="heading has-text-weight-bold">Contents</p> <p class="heading has-text-weight-bold">{{ trans(key="contents", lang=lang) }}</p>
<ul class="menu-list"> <ul class="menu-list">
{% for h1 in page.toc %} {% for h1 in page.toc %}
<li> <li>

View file

@ -0,0 +1,34 @@
<li class="lang-switcher">
<details class="dropdown">
<summary role="button" aria-haspopup="true" title="{{ trans(key="language_selection", lang=lang) }}" aria-label="{{ trans(key="language_selection", lang=lang) }}">
<span><div class="fas fa-globe"></div></span>
</summary>
<div class="dropdown-content" role="menu">
{#- Display the current language first in the dropdown -#}
{{ trans(key="language_name", lang=lang) | upper }}
{#- Loop through all the available languages in the config -#}
{%- for lcode, ldetails in config.languages -%}
{#- Skip the current language to avoid linking to the current page -#}
{%- if lang == lcode -%}
{%- continue -%}
{%- endif -%}
{#- Dynamically load the language strings for each language -#}
{%- set other_language_strings = load_data(path="_index" ~ lcode ~ ".md", required=false) -%}
{#- Use the loaded language strings to get the language name -#}
{% set language_name = trans(key="language_name") %}
{#- Check if the language code matches the default language -#}
{%- if lcode == config.default_language -%}
{#- If it does, link to the root path (no language code in URL) -#}
<a role="menuitem" lang="{{ lcode }}" aria-label="{{ language_name }}" href="{{ current_url | replace(from='/' ~ lang ~ '/', to = '/') }}">{{ lcode | upper }}</a>
{#- Check if the current language is the default language -#}
{#- If it is, append the language code to the base URL -#}
{%- elif lang == config.default_language -%}
<a role="menuitem" lang="{{ lcode }}" aria-label="{{ language_name }}" href="{{ config.base_url }}/{{ lcode }}{{ current_path | default(value="/") | safe }}">{{ lcode | upper }}</a>
{%- else -%}
{#- If it's not, replace the current language code in the URL with the new one -#}
<a role="menuitem" lang="{{ lcode }}" aria-label="{{ language_name }}" href="{{ current_url | replace(from='/' ~ lang ~ '/', to='/' ~ lcode ~ '/') }}">{{ lcode | upper }}</a>
{%- endif -%}
{%- endfor -%}
</div>
</details>
</li>

View file

@ -49,7 +49,7 @@
<div class="content mt-2"> <div class="content mt-2">
{{ page.summary | safe }} {{ page.summary | safe }}
<a class="has-text-weight-semibold" href='{{ page.slug }}'> <a class="has-text-weight-semibold" href='{{ page.slug }}'>
Read More {{ trans(key="read", lang=lang) }}
<span class="icon is-small"> <span class="icon is-small">
<img src="/images/arrow-color.png"> <img src="/images/arrow-color.png">
</span> </span>

View file

@ -10,14 +10,13 @@
</span> </span>
Tags Tags
</h1> </h1>
<p class='subtitle is-4'>{{ terms | length }} tags in total</p>
<p> <p>
{% for tag in terms %} {% for tag in terms %}
<a href="/tags/{{tag.name | lower}}" class="mr-4"> <a href="{{get_url(path="", lang=lang)}}/tags/{{tag.name | lower}}" class="mr-4">
<span class="icon is-small"> <span class="icon is-small">
<img src="/images/tag.png"> <img src="/images/tag.png">
</span> </span>
<span>{{tag.name}} <sup>{{ tag.pages | length }}</sup></span> <span>{{ trans(key=tag.name, lang=lang) }} <sup>{{ tag.pages | length }}</sup></span>
</a> </a>
{% endfor %} {% endfor %}
</p> </p>

View file

@ -10,7 +10,9 @@
<span class="icon is-small"> <span class="icon is-small">
<img src="/images/tag.png"> <img src="/images/tag.png">
</span> </span>
<span>{{ term.name }}</span> <span>
{{ trans(key=term.name, lang=lang) }}
</span>
</span> </span>
</h1> </h1>
</div> </div>