Merge pull request #46 from marcelhuth/i18n
Localization support for Flex theme
This commit is contained in:
commit
2947c38fbc
16 changed files with 130 additions and 23 deletions
|
@ -4,6 +4,8 @@ python:
|
|||
- "3.4"
|
||||
install:
|
||||
- pip install pelican markdown
|
||||
before_script:
|
||||
- git clone https://github.com/getpelican/pelican-plugins plugins
|
||||
script: pelican -s tests/pelicanconf.py
|
||||
notifications:
|
||||
email: false
|
||||
email: false
|
||||
|
|
1
babel.cfg
Normal file
1
babel.cfg
Normal file
|
@ -0,0 +1 @@
|
|||
[jinja2: templates/**.html]
|
|
@ -1,10 +1,10 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title %} – Archives{% endblock %}
|
||||
{% block title %} – {% trans %}Archives{% endtrans %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<article>
|
||||
<header>
|
||||
<h1>Archives</h1>
|
||||
<h1>{% trans %}Archives{% endtrans %}</h1>
|
||||
</header>
|
||||
<div>
|
||||
<dl>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<article>
|
||||
<header>
|
||||
<h1 id="{{ article.slug }}">{{ article.title }}</h1>
|
||||
<p>Posted on {{ article.locale_date }} in <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a></p>
|
||||
<p>{% trans %}Posted on{% endtrans %} {{ article.locale_date }} {% trans %}in{% endtrans %} <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a></p>
|
||||
</header>
|
||||
<div>
|
||||
{{ article.content }}
|
||||
|
@ -29,14 +29,14 @@
|
|||
</div>
|
||||
{% if ADD_THIS_ID %}
|
||||
<div class="center social-share">
|
||||
<p>Like this article? Share it with your friends!</p>
|
||||
<p>{% trans %}Like this article? Share it with your friends!{% endtrans %}</p>
|
||||
<div class="addthis_native_toolbox"></div>
|
||||
<div class="addthis_sharing_toolbox"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if article.related_posts %}
|
||||
<div class="related-posts">
|
||||
<h4>Related posts:</h4>
|
||||
<h4>{% trans %}Related posts{% endtrans %}:</h4>
|
||||
<ul>
|
||||
{% for related_post in article.related_posts %}
|
||||
<li><a href="{{ SITEURL }}/{{ related_post.url }}">{{ related_post.title }}</a></li>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{% extends "index.html" %}
|
||||
{% block title %} – Posts by: {{ author }}{% endblock %}
|
||||
{% block title %} – {% trans %}Posts by{% endtrans %}: {{ author }}{% endblock %}
|
||||
{% set summarise = True %}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title %} – Authors{% endblock %}
|
||||
{% block title %} – {% trans %}Authors{% endtrans %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<article>
|
||||
<header>
|
||||
<h1>Authors</h1>
|
||||
<h1>{% trans %}Authors{% endtrans %}</h1>
|
||||
</header>
|
||||
<div>
|
||||
<ul class="list">
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title %} – Categories{% endblock %}
|
||||
{% block title %} – {% trans %}Categories{% endtrans %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<article>
|
||||
<header>
|
||||
<h1>Categories</h1>
|
||||
<h1>{% trans %}Categories{% endtrans %}</h1>
|
||||
</header>
|
||||
<div>
|
||||
<ul class="list">
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{% extends "index.html" %}
|
||||
{% block title %} – Category: {{ category }}{% endblock %}
|
||||
{% block title %} – {% trans %}Category{% endtrans %}: {{ category }}{% endblock %}
|
||||
{% set summarise = True %}
|
||||
|
|
|
@ -6,22 +6,22 @@
|
|||
<header>
|
||||
<h2><a href="{{ SITEURL }}/{{ article.url }}#{{ article.slug }}">{{ article.title }}</a></h2>
|
||||
<p>
|
||||
Posted on {{ article.locale_date }} in <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>
|
||||
{% trans %}Posted on{% endtrans %} {{ article.locale_date }} {% trans %}in{% endtrans %} <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>
|
||||
{% if article.tags %}
|
||||
• Tagged with
|
||||
• {% trans %}Tagged with{% endtrans %}
|
||||
{% for tag in article.tags %}
|
||||
<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a>{% if not loop.last %},{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if DISQUS_SITENAME %}
|
||||
• <a href="{{ SITEURL }}/{{ article.url }}#disqus_thread">Leave a comment</a>
|
||||
• <a href="{{ SITEURL }}/{{ article.url }}#disqus_thread">{% trans %}Leave a comment{% endtrans %}</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
</header>
|
||||
<div>
|
||||
{% if summarise or article.metadata['summary'] or SUMMARY_MAX_LENGTH %}
|
||||
{{ article.summary }}
|
||||
<a class="btn" href="{{ SITEURL }}/{{ article.url }}#{{ article.slug }}">Continue reading</a>
|
||||
<a class="btn" href="{{ SITEURL }}/{{ article.url }}#{{ article.slug }}">{% trans %}Continue reading{% endtrans %}</a>
|
||||
{% else %}
|
||||
{{ article.content }}
|
||||
{% endif %}
|
||||
|
|
|
@ -8,5 +8,5 @@
|
|||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
|
||||
<noscript>{% trans %}Please enable JavaScript to view the{% endtrans %} <a href="https://disqus.com/?ref_noscript" rel="nofollow">{% trans %}comments powered by Disqus{% endtrans %}.</a></noscript>
|
||||
{% endif %}
|
||||
|
|
|
@ -1 +1 @@
|
|||
<p>Built using <a href="http://getpelican.com" target="_blank">Pelican</a> - <a href="https://github.com/alexandrevicenzi/flex" target="_blank">Flex</a> theme by <a href="http://alexandrevicenzi.com" target="_blank">Alexandre Vicenzi</a></p>
|
||||
<p>{% trans %}Built using{% endtrans %} <a href="http://getpelican.com" target="_blank">Pelican</a> - <a href="https://github.com/alexandrevicenzi/flex" target="_blank">Flex</a> {% trans %}theme by{% endtrans %} <a href="http://alexandrevicenzi.com" target="_blank">Alexandre Vicenzi</a></p>
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
<div class="pagination">
|
||||
{% if articles_page.has_next() %}
|
||||
<a class="btn" href="{{ SITEURL }}/{{ articles_next_page.url }}">
|
||||
<i class="fa fa-angle-left"></i> Older Posts
|
||||
<i class="fa fa-angle-left"></i> {% trans %}Older Posts{% endtrans %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if articles_page.has_previous() %}
|
||||
<a class="btn float-right" href="{{ SITEURL }}/{{ articles_previous_page.url }}">
|
||||
Newer Posts <i class="fa fa-angle-right"></i>
|
||||
{% trans %}Newer Posts{% endtrans %} <i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{% extends "index.html" %}
|
||||
{% block title %} – Tag: {{ tag }}{% endblock %}
|
||||
{% block title %} – {% trans %}Tag{% endtrans %}: {{ tag }}{% endblock %}
|
||||
{% set summarise = True %}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title %} – Tags{% endblock %}
|
||||
{% block title %} – {% trans %}Tags{% endtrans %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<article>
|
||||
<header>
|
||||
<h1>Tags</h1>
|
||||
<h1>{% trans %}Tags{% endtrans %}</h1>
|
||||
</header>
|
||||
<div>
|
||||
<ul class="list">
|
||||
|
|
|
@ -3,6 +3,11 @@
|
|||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
PLUGIN_PATHS = ['../plugins']
|
||||
PLUGINS = ['i18n_subsites']
|
||||
|
||||
JINJA_EXTENSIONS = ['jinja2.ext.i18n']
|
||||
|
||||
AUTHOR = u'Test'
|
||||
SITEURL = u'http://localhost:8000'
|
||||
SITENAME = u"Test Blog"
|
||||
|
|
99
translations/de/LC_MESSAGES/messages.po
Normal file
99
translations/de/LC_MESSAGES/messages.po
Normal file
|
@ -0,0 +1,99 @@
|
|||
# German translations for pelican Flex theme by Alexandre Vicenzi.
|
||||
# Copyright (C) 2016 Marcel Huth
|
||||
# This file is distributed under the same license as the Flex theme by Alexandre Vicenzi project.
|
||||
# Marcel Huth <marcelhuth@users.noreply.github.com>, 2016.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: 1.0\n"
|
||||
"Report-Msgid-Bugs-To: marcelhuth@users.noreply.github.com\n"
|
||||
"POT-Creation-Date: 2016-07-30 13:55+0200\n"
|
||||
"PO-Revision-Date: 2016-07-30 13:56+0200\n"
|
||||
"Last-Translator: Marcel Huth <marcelhuth@users.noreply.github.com>\n"
|
||||
"Language: de\n"
|
||||
"Language-Team: de <LL@li.org>\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 2.1.1\n"
|
||||
|
||||
#: templates/archives.html:2 templates/archives.html:7
|
||||
msgid "Archives"
|
||||
msgstr "Archive"
|
||||
|
||||
#: templates/article.html:16 templates/index.html:9
|
||||
msgid "Posted on"
|
||||
msgstr "Online seit"
|
||||
|
||||
#: templates/article.html:16 templates/index.html:9
|
||||
msgid "in"
|
||||
msgstr "in"
|
||||
|
||||
#: templates/article.html:32
|
||||
msgid "Like this article? Share it with your friends!"
|
||||
msgstr "Gefällt dir der Artikel? Dann teile ihn mit Freunden!"
|
||||
|
||||
#: templates/article.html:39
|
||||
msgid "Related posts"
|
||||
msgstr "Ähnliche Artikel"
|
||||
|
||||
#: templates/author.html:2
|
||||
msgid "Posts by"
|
||||
msgstr "Geschrieben von"
|
||||
|
||||
#: templates/authors.html:2 templates/authors.html:7
|
||||
msgid "Authors"
|
||||
msgstr "Autoren"
|
||||
|
||||
#: templates/categories.html:2 templates/categories.html:7
|
||||
msgid "Categories"
|
||||
msgstr "Kategorien"
|
||||
|
||||
#: templates/category.html:2
|
||||
msgid "Category"
|
||||
msgstr "Kategorie"
|
||||
|
||||
#: templates/index.html:11
|
||||
msgid "Tagged with"
|
||||
msgstr "Stichwörter"
|
||||
|
||||
#: templates/index.html:17
|
||||
msgid "Leave a comment"
|
||||
msgstr "Schreib einen Kommentar"
|
||||
|
||||
#: templates/index.html:24
|
||||
msgid "Continue reading"
|
||||
msgstr "Weiterlesen"
|
||||
|
||||
#: templates/tag.html:2
|
||||
msgid "Tag"
|
||||
msgstr "Stichwört"
|
||||
|
||||
#: templates/tags.html:2 templates/tags.html:7
|
||||
msgid "Tags"
|
||||
msgstr "Stichwörter"
|
||||
|
||||
#: templates/partial/disqus.html:11
|
||||
msgid "Please enable JavaScript to view the"
|
||||
msgstr "Bitte aktiviere JavaScript um die"
|
||||
|
||||
#: templates/partial/disqus.html:11
|
||||
msgid "comments powered by Disqus"
|
||||
msgstr "Kommentare von Disqus anzuzeigen"
|
||||
|
||||
#: templates/partial/flex.html:1
|
||||
msgid "Built using"
|
||||
msgstr "Erstellt mit"
|
||||
|
||||
#: templates/partial/flex.html:1
|
||||
msgid "theme by"
|
||||
msgstr "Theme von"
|
||||
|
||||
#: templates/partial/pagination.html:5
|
||||
msgid "Older Posts"
|
||||
msgstr "Ältere Artikel"
|
||||
|
||||
#: templates/partial/pagination.html:10
|
||||
msgid "Newer Posts"
|
||||
msgstr "Neuere Artikel"
|
Loading…
Reference in a new issue