From a6000685cfcbb4253f634b44637b599cec96d5bc Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 18 Feb 2024 13:58:34 +0100 Subject: Create basic German version of website --- templates/footer.html | 2 +- templates/nav.html | 11 +++++++++-- templates/section.html | 8 ++++---- templates/taxonomy_list.html | 2 +- templates/taxonomy_single.html | 2 +- 5 files changed, 16 insertions(+), 9 deletions(-) (limited to 'templates') diff --git a/templates/footer.html b/templates/footer.html index c952a93..6d4f0f7 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -1,5 +1,5 @@ diff --git a/templates/nav.html b/templates/nav.html index a71652e..cd2d391 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,9 +1,16 @@ +{% set current_lang = config.default_language %} +{% if page %} + {% set current_lang = page.lang %} +{% elif section %} + {% set current_lang = section.lang %} +{% endif %} {%- if config.extra.main_menu %} {%- for item in config.extra.main_menu %} + {% set language_key = 'name_' ~ current_lang %} {%- if item.url is matching("https?://") %} - {{ item.name }} + {{ item[language_key] }} {%- else %} - {{ item.name }} + {{ item[language_key] }} {%- endif %} {%- endfor %} {%- endif -%} diff --git a/templates/section.html b/templates/section.html index f3c218a..9560719 100644 --- a/templates/section.html +++ b/templates/section.html @@ -3,9 +3,9 @@ {% block main %}
{%- if taxonomy.term %} -

Filtering for "{{ section.title }}"

+

{{ trans(key="filtering_for",lang=lang)}} "{{ section.title }}"

- Remove filter + {{ trans(key="remove_filter", lang=lang) }} {%- endif %}
- {% set tags = get_taxonomy(kind="tags") %} + {% set tags = get_taxonomy(kind="tags", lang=lang) %} {% for post in tags.items %} #{{ post.name }}  {% endfor %} diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html index 98b8fc9..4b4e08a 100644 --- a/templates/taxonomy_list.html +++ b/templates/taxonomy_list.html @@ -5,7 +5,7 @@

{{ taxonomy.name | capitalize }}

- {% set tags = get_taxonomy(kind="tags") %} + {% set tags = get_taxonomy(kind="tags", lang=lang) %} {% for post in tags.items %} #{{ post.name }}  {% endfor %} diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html index 0f640a2..a8ca536 100644 --- a/templates/taxonomy_single.html +++ b/templates/taxonomy_single.html @@ -22,7 +22,7 @@ {% else %}
  • - No posts yet + {{ trans(key="no_posts", lang=lang) }}
  • {% endfor %} -- cgit 1.4.1