From ebd461741fd5a30e6fac74a77c3707de0802e163 Mon Sep 17 00:00:00 2001 From: "mb@mb" Date: Wed, 13 Jun 2018 18:46:31 +0200 Subject: [PATCH] added global variables for translated strings --- themes/varia/templates/article.html | 63 +++++++++++++++++++---------- themes/varia/templates/index.html | 38 +++++++++++------ 2 files changed, 68 insertions(+), 33 deletions(-) diff --git a/themes/varia/templates/article.html b/themes/varia/templates/article.html index 2d9fe52..ec868c2 100644 --- a/themes/varia/templates/article.html +++ b/themes/varia/templates/article.html @@ -20,6 +20,27 @@ {% endfor %} +{% set glob={} %} +{% if article.translations %} + {% for translation in article.translations %} + {% if translation.lang == 'nl' %} + {% set _ = glob.update({'published_at': 'Published at '}) %} + {% set _ = glob.update({'translate_article': 'Lees dit artikel in het Nederlands'}) %} + {% set _ = glob.update({'related_to': ' relating to '}) %} + {% set _ = glob.update({'translation_url': translation.url}) %} + {% set _ = glob.update({'written_by': 'Written by '}) %} + {% endif %} + {% if translation.lang == 'en' %} + {% set _ = glob.update({'published_at': 'Gepubliceerd op '}) %} + {% set _ = glob.update({'translate_article': 'Read this article in English'}) %} + {% set _ = glob.update({'related_to': ' gerelateerd aan '}) %} + {% set _ = glob.update({'translation_url': translation.url}) %} + {% set _ = glob.update({'written_by': 'Geschreven door '}) %} + {% endif %} + {% endfor %} +{% endif %} + +
{{ article.title }} @@ -38,40 +59,40 @@
{% if article.event_start %} -
{{ article.event_start }}
- {% else %} -
Published: {{ article.date | strftime('%d %B %Y') }}
+
{{ article.event_start }}
{% endif %} +
{{ glob.published_at }} {{ article.date | strftime('%d %B %Y') }}
diff --git a/themes/varia/templates/index.html b/themes/varia/templates/index.html index 86bf94a..d5ed123 100644 --- a/themes/varia/templates/index.html +++ b/themes/varia/templates/index.html @@ -10,13 +10,30 @@ {% endif %} {% endfor %} + +{% set glob={} %} + +{% if DEFAULT_LANG == 'nl' %} + {% set _ = glob.update({'published_at': 'Gepubliceerd op '}) %} + {% set _ = glob.update({'related_to': ' gerelateerd aan '}) %} + {% set _ = glob.update({'written_by': 'Geschreven door '}) %} + {% set _ = glob.update({'read_more': 'lees meer '}) %} +{% endif %} +{% if DEFAULT_LANG == 'en' %} + {% set _ = glob.update({'published_at': 'Published at '}) %} + {% set _ = glob.update({'related_to': ' relating to '}) %} + {% set _ = glob.update({'written_by': 'Written by '}) %} + {% set _ = glob.update({'read_more': 'read more'}) %} +{% endif %} + {% block content_title %} {% endblock %} + {% if articles_page.has_other_pages() %} {% include 'pagination.html' %} {% endif %} -
+
{% for article in articles_page.object_list %} {% set thumb_size = '/thumb' %} {% if article.category %} @@ -31,27 +48,23 @@ {% endif %} {% if article.category == 'article' %} {% set thumb_size = '/thumb2x' %} - {% endif %} - {% if article.category == 'documentation' %} - {% set thumb_size = '/thumb2x' %} {% endif %} {% endif %}
{% endif %}