From 5497850c517bcb0c08652c7a90feab34efc8d022 Mon Sep 17 00:00:00 2001 From: Marcel Huth Date: Wed, 10 Aug 2016 19:28:32 +0200 Subject: [PATCH] Reworked to newstyle gettext and named vars --- babel.cfg | 1 + templates/archives.html | 4 +- templates/article.html | 12 +++- templates/author.html | 2 +- templates/authors.html | 4 +- templates/categories.html | 4 +- templates/category.html | 2 +- templates/index.html | 12 ++-- templates/partial/disqus.html | 8 ++- templates/partial/flex.html | 7 ++- templates/partial/pagination.html | 4 +- templates/tag.html | 2 +- templates/tags.html | 4 +- translations/de/LC_MESSAGES/messages.po | 77 +++++++++++++------------ 14 files changed, 83 insertions(+), 60 deletions(-) diff --git a/babel.cfg b/babel.cfg index 2274808..cbbbc92 100644 --- a/babel.cfg +++ b/babel.cfg @@ -1 +1,2 @@ [jinja2: templates/**.html] +extensions=jinja2.ext.autoescape,jinja2.ext.with_ diff --git a/templates/archives.html b/templates/archives.html index d1a4fc0..c92ba57 100644 --- a/templates/archives.html +++ b/templates/archives.html @@ -1,10 +1,10 @@ {% extends "base.html" %} -{% block title %} – {% trans %}Archives{% endtrans %}{% endblock %} +{% block title %} – {{ _('Archives') }}{% endblock %} {% block content %}
-

{% trans %}Archives{% endtrans %}

+

{{ _('Archives') }}

diff --git a/templates/article.html b/templates/article.html index a3c3a0f..4896ca5 100644 --- a/templates/article.html +++ b/templates/article.html @@ -13,7 +13,13 @@

{{ article.title }}

-

{% trans %}Posted on{% endtrans %} {{ article.locale_date }} {% trans %}in{% endtrans %} {{ article.category }}

+

+ {% autoescape false %} + {{ _('Posted on %(when)s in %(category)s', + when=article.locale_date, + category='%s' % (SITEURL, article.category.url, article.category)) }} + {% endautoescape %} +

{{ article.content }} @@ -29,14 +35,14 @@
{% if ADD_THIS_ID %} {% endif %} {% if article.related_posts %}