Pluginless translation.

This commit is contained in:
Alexandre Vicenzi 2016-08-11 21:05:34 -03:00
parent 549a882acb
commit 723e047add
6 changed files with 18 additions and 22 deletions

View file

@ -14,9 +14,9 @@
<header>
<h1 id="{{ article.slug }}">{{ article.title }}</h1>
<p>
{% with category_url='<a href="%s/%s">%s</a>' % (SITEURL, article.category.url, article.category) %}
{{ _('Posted on %(when)s in %(category)s', when=article.locale_date, category=category_url|safe) }}
{% endwith %}
{{ _('Posted on %(when)s in %(category)s',
when=article.locale_date,
category='<a href="%s/%s">%s</a>'|format(SITEURL, article.category.url, article.category)|safe) }}
{% if 'post_stats' in PLUGINS %}
&#8226; {{ article.stats['read_mins'] }} min read

View file

@ -1,3 +1,9 @@
{% if 'jinja2.ext.i18n' not in JINJA_EXTENSIONS %}
{% macro _(msg) %}
{{ msg % kwargs }}
{% endmacro %}
{% endif %}
<!DOCTYPE html>
<html lang="{{ DEFAULT_LANG }}">
<head>

View file

@ -6,9 +6,9 @@
<header>
<h2><a href="{{ SITEURL }}/{{ article.url }}#{{ article.slug }}">{{ article.title }}</a></h2>
<p>
{% with category_url='<a href="%s/%s">%s</a>' % (SITEURL, article.category.url, article.category) %}
{{ _('Posted on %(when)s in %(category)s', when=article.locale_date, category=category_url|safe) }}
{% endwith %}
{{ _('Posted on %(when)s in %(category)s',
when=article.locale_date,
category='<a href="%s/%s">%s</a>'|format(SITEURL, article.category.url, article.category)|safe) }}
{% if 'post_stats' in PLUGINS %}
&#8226; {{ article.stats['read_mins'] }} min read