Localization of the template files

This commit is contained in:
Tobenna Peter Igwe 2017-04-06 07:38:23 +01:00
parent a63b8b7924
commit 0d6cbea619
11 changed files with 26 additions and 26 deletions

View File

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME }} - Archives{% endblock %}
{% block title %}{{ SITENAME }} - {{ gettext('Archives') }} {% endblock %}
{% block header %}
<!-- Page Header -->
@ -15,7 +15,7 @@
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="post-heading">
<h1>Archives for {{ SITENAME }}</h1>
<h1>{{ gettext('Archives for %(name)s', name=SITENAME) }}</h1>
</div>
</div>
</div>

View File

@ -105,14 +105,14 @@
{% if article.headline %}
<h3 class="subheading">{{ article.headline }}</h3>
{% endif %}
<span class="meta">Posted by
<span class="meta">{{ gettext('Posted by') }}
{% for author in article.authors %}
<a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>
{% endfor %}
on {{ article.locale_date }}
{{ gettext('on') }} {{ article.locale_date }}
</span>
{% if article.modified %}
<span class="meta">Updated on {{ article.locale_modified }}</span>
<span class="meta">{{ gettext('Updated on %(moddate)s', moddate=article.locale_modified) }}</span>
{% endif %}
{% import 'translations.html' as translations with context %}
{{ translations.translations_for(article) }}
@ -131,7 +131,7 @@
{% if article.tags %}
<div class="tags">
<p>tags: {% for tag in article.tags %}<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag | escape }}</a>{% if not loop.last %}, {% endif %}{% endfor %}</p>
<p>{{ gettext('tags') }} : {% for tag in article.tags %}<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag | escape }}</a>{% if not loop.last %}, {% endif %}{% endfor %}</p>
</div>
{% endif %}
@ -152,7 +152,7 @@
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the comments.</noscript>
<noscript>{{ gettext('Please enable JavaScript to view the comments.') }}</noscript>
</div>
{% endif %}
{% endblock content %}

View File

@ -1,10 +1,10 @@
{% extends "index.html" %}
{% block title %}{{ SITENAME }} - Articles by {{ author }}{% endblock %}
{% block title %}{{ SITENAME }} - {{ gettext('Articles by %(name)s', name=author) }}{% endblock %}
{% block opengraph %}
{{ super() }}
<meta property="og:title" content="{{ SITENAME }} - Articles by {{ author }}">
<meta property="og:title" content="{{ SITENAME }} - {{ gettext('Articles by %(name)s', name=author) }}">
<meta property="og:type" content="profile">
<meta property="profile:first_name" content="{{ author.name.split(' ')[0] }}">
<meta property="profile:last_name" content="{{ author.name.split(' ')[1:]|join(' ') }}">
@ -24,7 +24,7 @@
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="post-heading">
<h1>Articles by {{ author }}</h1>
<h1>{{ gettext('Articles by %(name)s', name=author) }}</h1>
</div>
</div>
</div>

View File

@ -1,6 +1,6 @@
{% extends "index.html" %}
{% block title %}{{ SITENAME }} - Authors{% endblock title %}
{% block title %}{{ SITENAME }} - {{ gettext('Authors') }}{% endblock title %}
{% block header %}
<!-- Page Header -->
@ -15,7 +15,7 @@
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="post-heading">
<h1>Articles by {{ author }}</h1>
<h1>{{ gettext('Articles by %(name)s', name=author) }}</h1>
</div>
</div>
</div>

View File

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME }} - Categories{% endblock %}
{% block title %}{{ SITENAME }} - {{ gettext('Categories') }}{% endblock %}
{% block header %}
<!-- Page Header -->
@ -15,7 +15,7 @@
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="post-heading">
<h1>{{ SITENAME }} - Categories</h1>
<h1>{{ SITENAME }} - {{ gettext('Categories') }}</h1>
</div>
</div>
</div>

View File

@ -1,6 +1,6 @@
{% extends "index.html" %}
{% block title %}{{ SITENAME }} - Articles in the {{ category }} category{% endblock %}
{% block title %}{{ SITENAME }} - {{ gettext('Articles in the %(category)s category', category=category) }}{% endblock %}
{% block header %}
<!-- Page Header -->
@ -15,7 +15,7 @@
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="post-heading">
<h1>Articles in the {{ category }} category</h1>
<h1>{{ gettext('Articles in the %(category)s category', category=category) }}</h1>
</div>
</div>
</div>

View File

@ -58,11 +58,11 @@
{% endif %}
</p>
{% endif %}
<p class="post-meta">Posted by
<p class="post-meta">{{ gettext('Posted by') }}
{% for author in article.authors %}
<a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>
{% endfor %}
on {{ article.locale_date }}
{{ gettext('on') }} {{ article.locale_date }}
</p>
{% include 'comments.html' %}
</div>

View File

@ -4,10 +4,10 @@
<ul class="pager">
<li class="next">
{% if articles_page.has_next() %}
<a href="{{ SITEURL }}/{{ articles_next_page.url }}">Older Posts &rarr;</a>
<a href="{{ SITEURL }}/{{ articles_next_page.url }}">{{ gettext('Older Posts') }} &rarr;</a>
{% endif %}
{% if articles_page.has_previous() %}
<a href="{{ SITEURL }}/{{ articles_previous_page.url }}"> &larr; Newest Posts</a>
<a href="{{ SITEURL }}/{{ articles_previous_page.url }}"> &larr; {{ gettext('Newest Posts') }}</a>
{% endif %}
</li>
</ul>

View File

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME }} - Archives for {{ period | reverse | join (' ') }}{% endblock %}
{% block title %}{{ SITENAME }} - {{ gettext('Archives for %(period)s', period=period | reverse | join (' ')) }}{% endblock %}
{% block header %}
<!-- Page Header -->
@ -15,7 +15,7 @@
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="post-heading">
<h1>Archives for {{ period | reverse | join (' ') }}</h1>
<h1>{{ gettext('Archives for %(period)s', period=period | reverse | join (' ')) }}</h1>
</div>
</div>
</div>

View File

@ -1,5 +1,5 @@
{% extends "index.html" %}
{% block title %}{{ SITENAME }} - Tag {{ tag }}{% endblock %}
{% block title %}{{ SITENAME }} - {{ gettext('Tag %(tag)s', tag=tag) }}{% endblock %}
{% block header %}
{% if HEADER_COVER %}
<header class="intro-header" style="background-image: url('{{ HEADER_COVER }}')">

View File

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME }} - Tags{% endblock %}
{% block title %}{{ SITENAME }} - {{ gettext('Tags') }}{% endblock %}
{% block header %}
<!-- Page Header -->
@ -15,7 +15,7 @@
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="post-heading">
<h1>{{ SITENAME }} - Tags</h1>
<h1>{{ SITENAME }} - {{ gettext('Tags') }}</h1>
</div>
</div>
</div>
@ -24,7 +24,7 @@
{% endblock header %}
{% block content %}
<h1>Tags for {{ SITENAME }}</h1>
<h1>{{ gettext('Tags for %(sitename)s', sitename=SITENAME) }}</h1>
{%- for tag, articles in tags|sort %}
<li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a> ({{ articles|count }})</li>
{% endfor %}