diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2016-10-06 15:02:40 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2016-12-13 18:46:05 +0100 |
commit | db5388e47885b76083ee6a169863b5e718ca1246 (patch) | |
tree | 218cfce1037c099a650cbb382b69d50de681f5e8 /pelican-bootstrap3/templates/includes | |
parent | 30c807519db25e1c9246a6c53b7545b36a2f1895 (diff) | |
download | pelican-themes-db5388e47885b76083ee6a169863b5e718ca1246.tar.gz |
Make pelican-bootstrap3 multilingual
This makes use of the i18n jinja extension as described in README.md.
A Makefile is provided to facilitate new translations. A translation to
German is also included.
Diffstat (limited to 'pelican-bootstrap3/templates/includes')
11 files changed, 31 insertions, 31 deletions
diff --git a/pelican-bootstrap3/templates/includes/aboutme.html b/pelican-bootstrap3/templates/includes/aboutme.html index 3dc1c1c..ee88d56 100644 --- a/pelican-bootstrap3/templates/includes/aboutme.html +++ b/pelican-bootstrap3/templates/includes/aboutme.html @@ -6,8 +6,8 @@ {% endif %} {% if ABOUT_ME %} <p> - <strong>About {{ AUTHOR }}</strong><br/> + <strong>{{ _('About') }} {{ AUTHOR }}</strong><br/> {{ ABOUT_ME }} </p> {% endif %} -</div>
\ No newline at end of file +</div> diff --git a/pelican-bootstrap3/templates/includes/article_info.html b/pelican-bootstrap3/templates/includes/article_info.html index e0c93b5..1cb85d5 100644 --- a/pelican-bootstrap3/templates/includes/article_info.html +++ b/pelican-bootstrap3/templates/includes/article_info.html @@ -5,7 +5,7 @@ </span> {% if SHOW_DATE_MODIFIED %} {% if article.modified %} - <span class="label label-default">Modified</span> + <span class="label label-default">{{ _('Modified') }}</span> <span class="modified"> <i class="fa fa-calendar"></i><time datetime="{{ article.modified.isoformat() }}"> {{ article.locale_modified }}</time> </span> @@ -14,20 +14,20 @@ {% if SHOW_SERIES %} {% if article.series %} - <span class="label label-default">Series</span> + <span class="label label-default">{{ _('Series') }}</span> Part {{ article.series.index}} of {{ article.series.name }} {% endif %} {% endif %} {% if SHOW_ARTICLE_AUTHOR %} {% if article.author %} - <span class="label label-default">By</span> + <span class="label label-default">{{ _('By') }}</span> <a href="{{ SITEURL }}/{{ article.author.url }}"><i class="fa fa-user"></i> {{ article.author }}</a> {% endif %} {% endif %} {% if SHOW_ARTICLE_CATEGORY %} - <span class="label label-default">Category</span> + <span class="label label-default">{{ _('Category') }}</span> <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a> {% endif %} diff --git a/pelican-bootstrap3/templates/includes/cc-license.html b/pelican-bootstrap3/templates/includes/cc-license.html index a1592e6..fca507d 100644 --- a/pelican-bootstrap3/templates/includes/cc-license.html +++ b/pelican-bootstrap3/templates/includes/cc-license.html @@ -54,12 +54,12 @@ {% endif %} {% endif %} {% set cc_title, cc_uri, cc_icon = ("Creative Commons AttributionCCSUFFIX 4.0 International License","https://creativecommons.org/licenses/CCNAME/4.0/","//i.creativecommons.org/l/CCNAME/4.0/80x15.png") %} - <a rel="license" href="{{ cc_uri|replace('CCNAME',cc_name) }}"><img alt="Creative Commons License" style="border-width:0" src="{{ cc_icon|replace('CCNAME',cc_name) }}" /></a> + <a rel="license" href="{{ cc_uri|replace('CCNAME',cc_name) }}deed.{{ attr_props['lang'] }}"><img alt="Creative Commons License" style="border-width:0" src="{{ cc_icon|replace('CCNAME',cc_name) }}" /></a> {% if br_after_img %}<br/>{% endif %} {% if attr_markup %} "<span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">{{ attr_props['title'] }}</span>" by <a xmlns:cc="http://creativecommons.org/ns#" href="{{ attr_props['url'] }}" property="cc:attributionName" rel="cc:attributionURL">{{ attr_props['name'] }}</a> is {% else %} - Content + {{ _('Content') }} {% endif %} - licensed under a <a rel="license" href="{{ cc_uri|replace('CCNAME',cc_name) }}">{{ cc_title|replace('CCSUFFIX',cc_title_suffix) }}</a>, except where indicated otherwise. + {{ _('licensed under a') }} <a rel="license" href="{{ cc_uri|replace('CCNAME',cc_name) }}deed.{{ attr_props['lang'] }}">{{ cc_title|replace('CCSUFFIX',cc_title_suffix) }}</a>, {{ _('except where indicated otherwise') }}. {% endmacro %} diff --git a/pelican-bootstrap3/templates/includes/comment_count.html b/pelican-bootstrap3/templates/includes/comment_count.html index 4b42dde..1e83035 100644 --- a/pelican-bootstrap3/templates/includes/comment_count.html +++ b/pelican-bootstrap3/templates/includes/comment_count.html @@ -1 +1 @@ -{% if DISQUS_SITENAME and DISQUS_DISPLAY_COUNTS %}<p><small><a href="{{ SITEURL }}/{{ article.url }}#disqus_thread" {% if not DISQUS_NO_ID %}data-disqus-identifier="{{ article.date|strftime('%Y-%m-') ~ article.slug if DISQUS_ID_PREFIX_SLUG else article.slug }}"{% endif %}>View comments</a>.</small></p>{% endif %} +{% if DISQUS_SITENAME and DISQUS_DISPLAY_COUNTS %}<p><small><a href="{{ SITEURL }}/{{ article.url }}#disqus_thread" {% if not DISQUS_NO_ID %}data-disqus-identifier="{{ article.date|strftime('%Y-%m-') ~ article.slug if DISQUS_ID_PREFIX_SLUG else article.slug }}"{% endif %}>{{ _('View comments') }}</a>.</small></p>{% endif %} diff --git a/pelican-bootstrap3/templates/includes/comments.html b/pelican-bootstrap3/templates/includes/comments.html index eade006..b37e2bf 100644 --- a/pelican-bootstrap3/templates/includes/comments.html +++ b/pelican-bootstrap3/templates/includes/comments.html @@ -1,7 +1,7 @@ {% if DISQUS_SITENAME %} <hr/> <section class="comments" id="comments"> - <h2>Comments</h2> + <h2>{{ _('Comments') }}</h2> <div id="disqus_thread"></div> <script type="text/javascript"> diff --git a/pelican-bootstrap3/templates/includes/footer.html b/pelican-bootstrap3/templates/includes/footer.html index b792835..ec0f258 100644 --- a/pelican-bootstrap3/templates/includes/footer.html +++ b/pelican-bootstrap3/templates/includes/footer.html @@ -12,17 +12,17 @@ {% set copy_date = '' %} {% endif %} <div class="col-xs-10">© {{ copy_date }} {{ AUTHOR }} - · Powered by <a href="https://github.com/getpelican/pelican-themes/tree/master/pelican-bootstrap3" target="_blank">pelican-bootstrap3</a>, + · {{ _('Powered by') }} <a href="https://github.com/getpelican/pelican-themes/tree/master/pelican-bootstrap3" target="_blank">pelican-bootstrap3</a>, <a href="http://docs.getpelican.com/" target="_blank">Pelican</a>, <a href="http://getbootstrap.com" target="_blank">Bootstrap</a> {%- if CC_LICENSE or CC_LICENSE_DERIVATIVES or CC_LICENSE_COMMERCIAL %} {% from 'includes/cc-license.html' import cc_license_mark %} - <p><small>{{ cc_license_mark(cc_name=CC_LICENSE,derivatives=CC_LICENSE_DERIVATIVES,commercial=CC_LICENSE_COMMERCIAL,attr_markup=CC_ATTR_MARKUP,attr_props={'title':SITENAME,'name':article.author if article else AUTHOR,'url':SITEURL}) }}</small></p> + <p><small>{{ cc_license_mark(cc_name=CC_LICENSE,derivatives=CC_LICENSE_DERIVATIVES,commercial=CC_LICENSE_COMMERCIAL,attr_markup=CC_ATTR_MARKUP,attr_props={'title':SITENAME,'name':article.author if article else AUTHOR,'url':SITEURL,'lang':DEFAULT_LANG}) }}</small></p> {% elif CUSTOM_LICENSE %} <p><small>{{ CUSTOM_LICENSE }}</small></p> {% endif %} </div> - <div class="col-xs-2"><p class="pull-right"><i class="fa fa-arrow-up"></i> <a href="#">Back to top</a></p></div> + <div class="col-xs-2"><p class="pull-right"><i class="fa fa-arrow-up"></i> <a href="#">{{ _('Back to top') }}</a></p></div> </div> </div> </footer> diff --git a/pelican-bootstrap3/templates/includes/links.html b/pelican-bootstrap3/templates/includes/links.html index 3286b5a..34898c4 100644 --- a/pelican-bootstrap3/templates/includes/links.html +++ b/pelican-bootstrap3/templates/includes/links.html @@ -1,5 +1,5 @@ {% if LINKS %} - <li class="list-group-item"><h4><i class="fa fa-external-link-square fa-lg"></i><span class="icon-label">Links</span></h4> + <li class="list-group-item"><h4><i class="fa fa-external-link-square fa-lg"></i><span class="icon-label">{{ _('Links') }}</span></h4> <ul class="list-group" id="links"> {% for name, link in LINKS %} <li class="list-group-item"> @@ -10,4 +10,4 @@ {% endfor %} </ul> </li> -{% endif %}
\ No newline at end of file +{% endif %} diff --git a/pelican-bootstrap3/templates/includes/pagination.html b/pelican-bootstrap3/templates/includes/pagination.html index e74cdba..cb34fa5 100644 --- a/pelican-bootstrap3/templates/includes/pagination.html +++ b/pelican-bootstrap3/templates/includes/pagination.html @@ -2,15 +2,15 @@ {% if USE_PAGER %} <ul class="pager"> {% if articles_page.has_previous() %} - <li class="previous"><a href="{{ SITEURL }}/{{ articles_previous_page.url }}">← Newer</a></li> + <li class="previous"><a href="{{ SITEURL }}/{{ articles_previous_page.url }}">← {{ _('Newer') }}</a></li> {% else %} - <li class="previous disabled"><a href="#">← Newer</a></li> + <li class="previous disabled"><a href="#">← {{ _('Newer') }}</a></li> {% endif %} {% if articles_page.has_next() %} <li class="next"><a - href="{{ SITEURL }}/{{ articles_next_page.url }}">Older →</a></li> + href="{{ SITEURL }}/{{ articles_next_page.url }}">{{ _('Older') }} →</a></li> {% else %} - <li class="next disabled"><a href="#">Older →</a></li> + <li class="next disabled"><a href="#">{{ _('Older') }} →</a></li> {% endif %} </ul> {% else %} @@ -34,4 +34,4 @@ {% endif %} </ul> {% endif %} -{% endif %}
\ No newline at end of file +{% endif %} diff --git a/pelican-bootstrap3/templates/includes/sidebar.html b/pelican-bootstrap3/templates/includes/sidebar.html index 4d7e6bb..57e345e 100644 --- a/pelican-bootstrap3/templates/includes/sidebar.html +++ b/pelican-bootstrap3/templates/includes/sidebar.html @@ -5,7 +5,7 @@ <section class="well well-sm"> <ul class="list-group list-group-flush"> {% if SOCIAL %} - <li class="list-group-item"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Social</span></h4> + <li class="list-group-item"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">{{ _('Social') }}</span></h4> <ul class="list-group" id="social"> {% for s in SOCIAL %} {% if s[2] %} @@ -28,7 +28,7 @@ {% if RECENT_POST_COUNT is not defined %} {% set RECENT_POST_COUNT = 5 %} {% endif %} - <li class="list-group-item"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Recent Posts</span></h4> + <li class="list-group-item"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">{{ _('Recent Posts') }}</span></h4> <ul class="list-group" id="recentposts"> {% for article in articles[:RECENT_POST_COUNT] %} <li class="list-group-item"> @@ -42,7 +42,7 @@ {% endif %} {% if DISPLAY_CATEGORIES_ON_SIDEBAR %} - <li class="list-group-item"><a href="{{ SITEURL }}/{{ CATEGORIES_URL }}"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Categories</span></h4></a> + <li class="list-group-item"><a href="{{ SITEURL }}/{{ CATEGORIES_URL }}"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">{{ _('Categories') }}</span></h4></a> <ul class="list-group" id="categories"> {% for cat, null in categories %} <li class="list-group-item"> @@ -61,7 +61,7 @@ {% else %} {% set tags = tag_cloud | sort(attribute='1') %} {% endif %} - <li class="list-group-item"><a href="{{ SITEURL }}/{{ TAGS_URL }}"><h4><i class="fa fa-tags fa-lg"></i><span class="icon-label">Tags</span></h4></a> + <li class="list-group-item"><a href="{{ SITEURL }}/{{ TAGS_URL }}"><h4><i class="fa fa-tags fa-lg"></i><span class="icon-label">{{ _('Tags') }}</span></h4></a> <ul class="list-group {% if DISPLAY_TAGS_INLINE %}list-inline tagcloud{% endif %}" id="tags"> {% for tag in tags %} <li class="list-group-item tag-{{ tag.1 }}"> @@ -77,17 +77,17 @@ {% if DISPLAY_SERIES_ON_SIDEBAR %} {% if article %} {% if article.series %} - <li class="list-group-item"><h4><i class="fa fa-tags fa-list-ul"></i><span class="icon-label">Series</span></h4> + <li class="list-group-item"><h4><i class="fa fa-tags fa-list-ul"></i><span class="icon-label">{{ _('Series') }}</span></h4> <ul class="list-group"> {% if article.series.previous %} <li class="list-group-item"> - <h5></i> Previous article</h5> + <h5></i>{{ _('Previous article') }}</h5> <a href="{{ SITEURL }}/{{ article.series.previous.url }}">{{ article.series.previous.title }}</a> </li> {% endif %} {% if article.series.next %} <li class="list-group-item"> - <h5>Next article</h5> + <h5>{{ _('Next article') }}</h5> <a href="{{ SITEURL }}/{{ article.series.next.url }}">{{ article.series.next.title }}</a> </li> {% endif %} diff --git a/pelican-bootstrap3/templates/includes/taglist.html b/pelican-bootstrap3/templates/includes/taglist.html index bcaa470..2aa0237 100644 --- a/pelican-bootstrap3/templates/includes/taglist.html +++ b/pelican-bootstrap3/templates/includes/taglist.html @@ -1,5 +1,5 @@ {% if article.tags %} -<span class="label label-default">Tags</span> +<span class="label label-default">{{ _('Tags') }}</span> {% for tag in article.tags %} <a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a> {% if not loop.last %} diff --git a/pelican-bootstrap3/templates/includes/translations.html b/pelican-bootstrap3/templates/includes/translations.html index ea693df..2d79217 100644 --- a/pelican-bootstrap3/templates/includes/translations.html +++ b/pelican-bootstrap3/templates/includes/translations.html @@ -1,8 +1,8 @@ {% macro translations_for(article) %} {% if article.translations %} -<span class="label label-default">Lang</span> +<span class="label label-default">{{ _('Lang') }}</span> {% for translation in article.translations %} <a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a> {% endfor %} {% endif %} -{% endmacro %}
\ No newline at end of file +{% endmacro %} |