Update the i18n_subsites plugin, addresses many issues
Major highlights ................ - fixed and improved cross-linking (fixes #333) with URLs containing e.g. localized month names (thanks to issue getpelican/pelican#1198) - support for custom ``SITEURL`` and ``OUTPUT_PATH`` hierarchy (fixes #182) - sharing of static files (including those of the theme) among subsites (fixes #180) Technical highlights .................... - added a test suite (works with pelican 3.4) - translations are installed into Jinja2 environments of all generators - old locale is restored after generation, fixes autoreload The documentation has been updated and improved (mostly in terms of formatting). Known issues ............ - due to the redesign required for correct cross-linking, older versions of Pelican (<3.4) are not supported, because they lack certain signals - the ``HIDE_UNTRANSLATED_CONTENT`` setting has been deprecated in favor of the ``I18N_UNTRANSLATED_{ARTICLES,PAGES}`` settings which offer more control in order to fix #211. - the test suite works only with pelican 3.4, later versions add a timezone field to the date
This commit is contained in:
0
test_data/content/images/img.png
Normal file
0
test_data/content/images/img.png
Normal file
5
test_data/content/pages/untranslated-page.rst
Normal file
5
test_data/content/pages/untranslated-page.rst
Normal file
@ -0,0 +1,5 @@
|
||||
Untranslated page
|
||||
=================
|
||||
:lang: en
|
||||
|
||||
This page has no translation.
|
8
test_data/content/translated_article-cz.rst
Normal file
8
test_data/content/translated_article-cz.rst
Normal file
@ -0,0 +1,8 @@
|
||||
Přeložený článek
|
||||
================
|
||||
:slug: translated-article
|
||||
:lang: cz
|
||||
:date: 2014-09-15
|
||||
|
||||
Jednoduchý článek s překlady.
|
||||
Zde je odkaz na `nějaký obrázek <{filename}/images/img.png>`_.
|
8
test_data/content/translated_article-de.rst
Normal file
8
test_data/content/translated_article-de.rst
Normal file
@ -0,0 +1,8 @@
|
||||
Ein übersetzter Artikel
|
||||
=======================
|
||||
:slug: translated-article
|
||||
:lang: de
|
||||
:date: 2014-09-14
|
||||
|
||||
Ein einfacher Artikel mit einer Übersetzung.
|
||||
Hier ist ein Link zur `einigem Bild <{filename}/images/img.png>`_.
|
8
test_data/content/translated_article-en.rst
Normal file
8
test_data/content/translated_article-en.rst
Normal file
@ -0,0 +1,8 @@
|
||||
A translated article
|
||||
====================
|
||||
:slug: translated-article
|
||||
:lang: en
|
||||
:date: 2014-09-13
|
||||
|
||||
A simple article with a translation.
|
||||
Here is a link to `some image <{filename}/images/img.png>`_.
|
9
test_data/content/untranslated_article-en.rst
Normal file
9
test_data/content/untranslated_article-en.rst
Normal file
@ -0,0 +1,9 @@
|
||||
An untranslated article
|
||||
=======================
|
||||
:date: 2014-07-14
|
||||
:lang: en
|
||||
|
||||
An article without a translation.
|
||||
Here is a link to an `untranslated page`_
|
||||
|
||||
.. _`untranslated page`: {filename}/pages/untranslated-page.rst
|
2
test_data/localized_theme/babel.cfg
Normal file
2
test_data/localized_theme/babel.cfg
Normal file
@ -0,0 +1,2 @@
|
||||
[jinja2: templates/**.html]
|
||||
|
23
test_data/localized_theme/messages.pot
Normal file
23
test_data/localized_theme/messages.pot
Normal file
@ -0,0 +1,23 @@
|
||||
# Translations template for PROJECT.
|
||||
# Copyright (C) 2014 ORGANIZATION
|
||||
# This file is distributed under the same license as the PROJECT project.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2014-07-13 12:25+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel 1.3\n"
|
||||
|
||||
#: templates/base.html:3
|
||||
msgid "Welcome to our"
|
||||
msgstr ""
|
||||
|
0
test_data/localized_theme/static/style.css
Normal file
0
test_data/localized_theme/static/style.css
Normal file
7
test_data/localized_theme/templates/base.html
Normal file
7
test_data/localized_theme/templates/base.html
Normal file
@ -0,0 +1,7 @@
|
||||
{% extends "!simple/base.html" %}
|
||||
|
||||
{% block title %}{% trans %}Welcome to our{% endtrans %} {{ SITENAME }}{% endblock %}
|
||||
{% block head %}
|
||||
{{ super() }}
|
||||
<link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/style.css" />
|
||||
{% endblock %}
|
Binary file not shown.
@ -0,0 +1,23 @@
|
||||
# German translations for PROJECT.
|
||||
# Copyright (C) 2014 ORGANIZATION
|
||||
# This file is distributed under the same license as the PROJECT project.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2014-07-13 12:25+0200\n"
|
||||
"PO-Revision-Date: 2014-07-13 12:26+0200\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\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 1.3\n"
|
||||
|
||||
#: templates/base.html:3
|
||||
msgid "Welcome to our"
|
||||
msgstr "Willkommen Sie zur unserer"
|
||||
|
50
test_data/output/an-untranslated-article.html
Normal file
50
test_data/output/an-untranslated-article.html
Normal file
@ -0,0 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Welcome to our Testing site</title>
|
||||
<meta charset="utf-8" />
|
||||
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" />
|
||||
|
||||
<link rel="stylesheet" href="http://example.com/test/theme/style.css" />
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body id="index" class="home">
|
||||
<header id="banner" class="body">
|
||||
<h1><a href="http://example.com/test/">Testing site <strong></strong></a></h1>
|
||||
</header><!-- /#banner -->
|
||||
<nav id="menu"><ul>
|
||||
<li><a href="http://example.com/test/pages/untranslated-page.html">Untranslated page</a></li>
|
||||
</ul></nav><!-- /#menu -->
|
||||
<section id="content" class="body">
|
||||
<header>
|
||||
<h2 class="entry-title">
|
||||
<a href="http://example.com/test/an-untranslated-article.html" rel="bookmark"
|
||||
title="Permalink to An untranslated article">An untranslated article</a></h2>
|
||||
|
||||
</header>
|
||||
<footer class="post-info">
|
||||
<abbr class="published" title="2014-07-14T00:00:00">
|
||||
Mon 14 July 2014
|
||||
</abbr>
|
||||
<address class="vcard author">
|
||||
By <a class="url fn" href="http://example.com/test/author/the-tester.html">The Tester</a>
|
||||
</address>
|
||||
</footer><!-- /.post-info -->
|
||||
<div class="entry-content">
|
||||
<p>An article without a translation.
|
||||
Here is a link to an <a class="reference external" href="http://example.com/test/pages/untranslated-page.html">untranslated page</a></p>
|
||||
|
||||
</div><!-- /.entry-content -->
|
||||
</section>
|
||||
<footer id="contentinfo" class="body">
|
||||
<address id="about" class="vcard body">
|
||||
Proudly powered by <a href="http://getpelican.com/">Pelican</a>,
|
||||
which takes great advantage of <a href="http://python.org">Python</a>.
|
||||
</address><!-- /#about -->
|
||||
</footer><!-- /#contentinfo -->
|
||||
</body>
|
||||
</html>
|
49
test_data/output/cz/an-untranslated-article-en.html
Normal file
49
test_data/output/cz/an-untranslated-article-en.html
Normal file
@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="cz">
|
||||
<head>
|
||||
<title>Welcome to our Testovací stránka</title>
|
||||
<meta charset="utf-8" />
|
||||
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Full Atom Feed" />
|
||||
|
||||
<link rel="stylesheet" href="http://example.com/test/cz/../theme/style.css" />
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body id="index" class="home">
|
||||
<header id="banner" class="body">
|
||||
<h1><a href="http://example.com/test/cz/">Testovací stránka <strong></strong></a></h1>
|
||||
</header><!-- /#banner -->
|
||||
<nav id="menu"><ul>
|
||||
</ul></nav><!-- /#menu -->
|
||||
<section id="content" class="body">
|
||||
<header>
|
||||
<h2 class="entry-title">
|
||||
<a href="http://example.com/test/cz/an-untranslated-article-en.html" rel="bookmark"
|
||||
title="Permalink to An untranslated article">An untranslated article</a></h2>
|
||||
|
||||
</header>
|
||||
<footer class="post-info">
|
||||
<abbr class="published" title="2014-07-14T00:00:00">
|
||||
Mon 14 July 2014
|
||||
</abbr>
|
||||
<address class="vcard author">
|
||||
By <a class="url fn" href="http://example.com/test/cz/author/test-testovic.html">Test Testovič</a>
|
||||
</address>
|
||||
</footer><!-- /.post-info -->
|
||||
<div class="entry-content">
|
||||
<p>An article without a translation.
|
||||
Here is a link to an <a class="reference external" href="http://example.com/test/cz/../pages/untranslated-page.html">untranslated page</a></p>
|
||||
|
||||
</div><!-- /.entry-content -->
|
||||
</section>
|
||||
<footer id="contentinfo" class="body">
|
||||
<address id="about" class="vcard body">
|
||||
Proudly powered by <a href="http://getpelican.com/">Pelican</a>,
|
||||
which takes great advantage of <a href="http://python.org">Python</a>.
|
||||
</address><!-- /#about -->
|
||||
</footer><!-- /#contentinfo -->
|
||||
</body>
|
||||
</html>
|
10
test_data/output/cz/feeds_all.atom.xml
Normal file
10
test_data/output/cz/feeds_all.atom.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom"><title>Testovací stránka</title><link href="http://example.com/test/cz/" rel="alternate"></link><link href="http://example.com/test/feeds_all.atom.xml" rel="self"></link><id>http://example.com/test/cz/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/cz/translated-article.html" rel="alternate"></link><updated>2014-09-15T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-09-15:test/cz/translated-article.html</id><summary type="html"><p>Jednoduchý článek s překlady.
|
||||
Zde je odkaz na <a class="reference external" href="http://example.com/test/cz/../images/img.png">nějaký obrázek</a>.</p>
|
||||
</summary></entry><entry><title>Ein übersetzter Artikel</title><link href="http://example.com/test/cz/../de/translated-article.html" rel="alternate"></link><updated>2014-09-14T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-09-14:test/cz/../de/translated-article.html</id><summary type="html"><p>Ein einfacher Artikel mit einer Übersetzung.
|
||||
Hier ist ein Link zur <a class="reference external" href="http://example.com/test/cz/../images/img.png">einigem Bild</a>.</p>
|
||||
</summary></entry><entry><title>A translated article</title><link href="http://example.com/test/cz/../translated-article.html" rel="alternate"></link><updated>2014-09-13T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-09-13:test/cz/../translated-article.html</id><summary type="html"><p>A simple article with a translation.
|
||||
Here is a link to <a class="reference external" href="http://example.com/test/cz/../images/img.png">some image</a>.</p>
|
||||
</summary></entry><entry><title>An untranslated article</title><link href="http://example.com/test/cz/an-untranslated-article-en.html" rel="alternate"></link><updated>2014-07-14T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-07-14:test/cz/an-untranslated-article-en.html</id><summary type="html"><p>An article without a translation.
|
||||
Here is a link to an <a class="reference external" href="http://example.com/test/cz/../pages/untranslated-page.html">untranslated page</a></p>
|
||||
</summary></entry></feed>
|
54
test_data/output/cz/index.html
Normal file
54
test_data/output/cz/index.html
Normal file
@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="cz">
|
||||
<head>
|
||||
<title>Welcome to our Testovací stránka</title>
|
||||
<meta charset="utf-8" />
|
||||
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Full Atom Feed" />
|
||||
|
||||
<link rel="stylesheet" href="http://example.com/test/cz/../theme/style.css" />
|
||||
</head>
|
||||
|
||||
<body id="index" class="home">
|
||||
<header id="banner" class="body">
|
||||
<h1><a href="http://example.com/test/cz/">Testovací stránka <strong></strong></a></h1>
|
||||
</header><!-- /#banner -->
|
||||
<nav id="menu"><ul>
|
||||
</ul></nav><!-- /#menu -->
|
||||
<section id="content">
|
||||
<h2>All articles</h2>
|
||||
|
||||
<ol id="post-list">
|
||||
<li><article class="hentry">
|
||||
<header> <h2 class="entry-title"><a href="http://example.com/test/cz/translated-article.html" rel="bookmark" title="Permalink to Přeložený článek">Přeložený článek</a></h2> </header>
|
||||
<footer class="post-info">
|
||||
<abbr class="published" title="2014-09-15T00:00:00"> Mon 15 September 2014 </abbr>
|
||||
<address class="vcard author">By
|
||||
<a class="url fn" href="http://example.com/test/cz/author/test-testovic.html">Test Testovič</a>
|
||||
</address>
|
||||
</footer><!-- /.post-info -->
|
||||
<div class="entry-content"> <p>Jednoduchý článek s překlady.
|
||||
Zde je odkaz na <a class="reference external" href="http://example.com/test/cz/../images/img.png">nějaký obrázek</a>.</p>
|
||||
</div><!-- /.entry-content -->
|
||||
</article></li>
|
||||
<li><article class="hentry">
|
||||
<header> <h2 class="entry-title"><a href="http://example.com/test/cz/an-untranslated-article-en.html" rel="bookmark" title="Permalink to An untranslated article">An untranslated article</a></h2> </header>
|
||||
<footer class="post-info">
|
||||
<abbr class="published" title="2014-07-14T00:00:00"> Mon 14 July 2014 </abbr>
|
||||
<address class="vcard author">By
|
||||
<a class="url fn" href="http://example.com/test/cz/author/test-testovic.html">Test Testovič</a>
|
||||
</address>
|
||||
</footer><!-- /.post-info -->
|
||||
<div class="entry-content"> <p>An article without a translation.
|
||||
Here is a link to an <a class="reference external" href="http://example.com/test/cz/../pages/untranslated-page.html">untranslated page</a></p>
|
||||
</div><!-- /.entry-content -->
|
||||
</article></li>
|
||||
</ol><!-- /#posts-list -->
|
||||
</section><!-- /#content -->
|
||||
<footer id="contentinfo" class="body">
|
||||
<address id="about" class="vcard body">
|
||||
Proudly powered by <a href="http://getpelican.com/">Pelican</a>,
|
||||
which takes great advantage of <a href="http://python.org">Python</a>.
|
||||
</address><!-- /#about -->
|
||||
</footer><!-- /#contentinfo -->
|
||||
</body>
|
||||
</html>
|
52
test_data/output/cz/translated-article.html
Normal file
52
test_data/output/cz/translated-article.html
Normal file
@ -0,0 +1,52 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="cz">
|
||||
<head>
|
||||
<title>Welcome to our Testovací stránka</title>
|
||||
<meta charset="utf-8" />
|
||||
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Full Atom Feed" />
|
||||
|
||||
<link rel="stylesheet" href="http://example.com/test/cz/../theme/style.css" />
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body id="index" class="home">
|
||||
<header id="banner" class="body">
|
||||
<h1><a href="http://example.com/test/cz/">Testovací stránka <strong></strong></a></h1>
|
||||
</header><!-- /#banner -->
|
||||
<nav id="menu"><ul>
|
||||
</ul></nav><!-- /#menu -->
|
||||
<section id="content" class="body">
|
||||
<header>
|
||||
<h2 class="entry-title">
|
||||
<a href="http://example.com/test/cz/translated-article.html" rel="bookmark"
|
||||
title="Permalink to Přeložený článek">Přeložený článek</a></h2>
|
||||
Translations:
|
||||
<a href="http://example.com/test/cz/../de/translated-article.html">de</a>
|
||||
<a href="http://example.com/test/cz/../translated-article.html">en</a>
|
||||
|
||||
</header>
|
||||
<footer class="post-info">
|
||||
<abbr class="published" title="2014-09-15T00:00:00">
|
||||
Mon 15 September 2014
|
||||
</abbr>
|
||||
<address class="vcard author">
|
||||
By <a class="url fn" href="http://example.com/test/cz/author/test-testovic.html">Test Testovič</a>
|
||||
</address>
|
||||
</footer><!-- /.post-info -->
|
||||
<div class="entry-content">
|
||||
<p>Jednoduchý článek s překlady.
|
||||
Zde je odkaz na <a class="reference external" href="http://example.com/test/cz/../images/img.png">nějaký obrázek</a>.</p>
|
||||
|
||||
</div><!-- /.entry-content -->
|
||||
</section>
|
||||
<footer id="contentinfo" class="body">
|
||||
<address id="about" class="vcard body">
|
||||
Proudly powered by <a href="http://getpelican.com/">Pelican</a>,
|
||||
which takes great advantage of <a href="http://python.org">Python</a>.
|
||||
</address><!-- /#about -->
|
||||
</footer><!-- /#contentinfo -->
|
||||
</body>
|
||||
</html>
|
49
test_data/output/de/drafts/an-untranslated-article-en.html
Normal file
49
test_data/output/de/drafts/an-untranslated-article-en.html
Normal file
@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Willkommen Sie zur unserer Testseite</title>
|
||||
<meta charset="utf-8" />
|
||||
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" />
|
||||
|
||||
<link rel="stylesheet" href="http://example.com/test/de/../theme/style.css" />
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body id="index" class="home">
|
||||
<header id="banner" class="body">
|
||||
<h1><a href="http://example.com/test/de/">Testseite <strong></strong></a></h1>
|
||||
</header><!-- /#banner -->
|
||||
<nav id="menu"><ul>
|
||||
</ul></nav><!-- /#menu -->
|
||||
<section id="content" class="body">
|
||||
<header>
|
||||
<h2 class="entry-title">
|
||||
<a href="http://example.com/test/de/drafts/an-untranslated-article-en.html" rel="bookmark"
|
||||
title="Permalink to An untranslated article">An untranslated article</a></h2>
|
||||
|
||||
</header>
|
||||
<footer class="post-info">
|
||||
<abbr class="published" title="2014-07-14T00:00:00">
|
||||
Mo 14 Juli 2014
|
||||
</abbr>
|
||||
<address class="vcard author">
|
||||
By <a class="url fn" href="http://example.com/test/de/author/der-tester.html">Der Tester</a>
|
||||
</address>
|
||||
</footer><!-- /.post-info -->
|
||||
<div class="entry-content">
|
||||
<p>An article without a translation.
|
||||
Here is a link to an <a class="reference external" href="http://example.com/test/de/pages/untranslated-page-en.html">untranslated page</a></p>
|
||||
|
||||
</div><!-- /.entry-content -->
|
||||
</section>
|
||||
<footer id="contentinfo" class="body">
|
||||
<address id="about" class="vcard body">
|
||||
Proudly powered by <a href="http://getpelican.com/">Pelican</a>,
|
||||
which takes great advantage of <a href="http://python.org">Python</a>.
|
||||
</address><!-- /#about -->
|
||||
</footer><!-- /#contentinfo -->
|
||||
</body>
|
||||
</html>
|
8
test_data/output/de/feeds_all.atom.xml
Normal file
8
test_data/output/de/feeds_all.atom.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom"><title>Testseite</title><link href="http://example.com/test/de/" rel="alternate"></link><link href="http://example.com/test/feeds_all.atom.xml" rel="self"></link><id>http://example.com/test/de/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/de/../cz/translated-article.html" rel="alternate"></link><updated>2014-09-15T00:00:00+00:00</updated><author><name>Der Tester</name></author><id>tag:example.com,2014-09-15:test/de/../cz/translated-article.html</id><summary type="html"><p>Jednoduchý článek s překlady.
|
||||
Zde je odkaz na <a class="reference external" href="http://example.com/test/de/../images/img.png">nějaký obrázek</a>.</p>
|
||||
</summary></entry><entry><title>Ein übersetzter Artikel</title><link href="http://example.com/test/de/translated-article.html" rel="alternate"></link><updated>2014-09-14T00:00:00+00:00</updated><author><name>Der Tester</name></author><id>tag:example.com,2014-09-14:test/de/translated-article.html</id><summary type="html"><p>Ein einfacher Artikel mit einer Übersetzung.
|
||||
Hier ist ein Link zur <a class="reference external" href="http://example.com/test/de/../images/img.png">einigem Bild</a>.</p>
|
||||
</summary></entry><entry><title>A translated article</title><link href="http://example.com/test/de/../translated-article.html" rel="alternate"></link><updated>2014-09-13T00:00:00+00:00</updated><author><name>Der Tester</name></author><id>tag:example.com,2014-09-13:test/de/../translated-article.html</id><summary type="html"><p>A simple article with a translation.
|
||||
Here is a link to <a class="reference external" href="http://example.com/test/de/../images/img.png">some image</a>.</p>
|
||||
</summary></entry></feed>
|
42
test_data/output/de/index.html
Normal file
42
test_data/output/de/index.html
Normal file
@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Willkommen Sie zur unserer Testseite</title>
|
||||
<meta charset="utf-8" />
|
||||
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" />
|
||||
|
||||
<link rel="stylesheet" href="http://example.com/test/de/../theme/style.css" />
|
||||
</head>
|
||||
|
||||
<body id="index" class="home">
|
||||
<header id="banner" class="body">
|
||||
<h1><a href="http://example.com/test/de/">Testseite <strong></strong></a></h1>
|
||||
</header><!-- /#banner -->
|
||||
<nav id="menu"><ul>
|
||||
</ul></nav><!-- /#menu -->
|
||||
<section id="content">
|
||||
<h2>All articles</h2>
|
||||
|
||||
<ol id="post-list">
|
||||
<li><article class="hentry">
|
||||
<header> <h2 class="entry-title"><a href="http://example.com/test/de/translated-article.html" rel="bookmark" title="Permalink to Ein übersetzter Artikel">Ein übersetzter Artikel</a></h2> </header>
|
||||
<footer class="post-info">
|
||||
<abbr class="published" title="2014-09-14T00:00:00"> So 14 September 2014 </abbr>
|
||||
<address class="vcard author">By
|
||||
<a class="url fn" href="http://example.com/test/de/author/der-tester.html">Der Tester</a>
|
||||
</address>
|
||||
</footer><!-- /.post-info -->
|
||||
<div class="entry-content"> <p>Ein einfacher Artikel mit einer Übersetzung.
|
||||
Hier ist ein Link zur <a class="reference external" href="http://example.com/test/de/../images/img.png">einigem Bild</a>.</p>
|
||||
</div><!-- /.entry-content -->
|
||||
</article></li>
|
||||
</ol><!-- /#posts-list -->
|
||||
</section><!-- /#content -->
|
||||
<footer id="contentinfo" class="body">
|
||||
<address id="about" class="vcard body">
|
||||
Proudly powered by <a href="http://getpelican.com/">Pelican</a>,
|
||||
which takes great advantage of <a href="http://python.org">Python</a>.
|
||||
</address><!-- /#about -->
|
||||
</footer><!-- /#contentinfo -->
|
||||
</body>
|
||||
</html>
|
30
test_data/output/de/pages/untranslated-page-en.html
Normal file
30
test_data/output/de/pages/untranslated-page-en.html
Normal file
@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Untranslated page</title>
|
||||
<meta charset="utf-8" />
|
||||
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" />
|
||||
|
||||
<link rel="stylesheet" href="http://example.com/test/de/../theme/style.css" />
|
||||
</head>
|
||||
|
||||
<body id="index" class="home">
|
||||
<header id="banner" class="body">
|
||||
<h1><a href="http://example.com/test/de/">Testseite <strong></strong></a></h1>
|
||||
</header><!-- /#banner -->
|
||||
<nav id="menu"><ul>
|
||||
</ul></nav><!-- /#menu -->
|
||||
<h1>Untranslated page</h1>
|
||||
|
||||
|
||||
<p>This page has no translation.</p>
|
||||
|
||||
|
||||
<footer id="contentinfo" class="body">
|
||||
<address id="about" class="vcard body">
|
||||
Proudly powered by <a href="http://getpelican.com/">Pelican</a>,
|
||||
which takes great advantage of <a href="http://python.org">Python</a>.
|
||||
</address><!-- /#about -->
|
||||
</footer><!-- /#contentinfo -->
|
||||
</body>
|
||||
</html>
|
52
test_data/output/de/translated-article.html
Normal file
52
test_data/output/de/translated-article.html
Normal file
@ -0,0 +1,52 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Willkommen Sie zur unserer Testseite</title>
|
||||
<meta charset="utf-8" />
|
||||
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" />
|
||||
|
||||
<link rel="stylesheet" href="http://example.com/test/de/../theme/style.css" />
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body id="index" class="home">
|
||||
<header id="banner" class="body">
|
||||
<h1><a href="http://example.com/test/de/">Testseite <strong></strong></a></h1>
|
||||
</header><!-- /#banner -->
|
||||
<nav id="menu"><ul>
|
||||
</ul></nav><!-- /#menu -->
|
||||
<section id="content" class="body">
|
||||
<header>
|
||||
<h2 class="entry-title">
|
||||
<a href="http://example.com/test/de/translated-article.html" rel="bookmark"
|
||||
title="Permalink to Ein übersetzter Artikel">Ein übersetzter Artikel</a></h2>
|
||||
Translations:
|
||||
<a href="http://example.com/test/de/../cz/translated-article.html">cz</a>
|
||||
<a href="http://example.com/test/de/../translated-article.html">en</a>
|
||||
|
||||
</header>
|
||||
<footer class="post-info">
|
||||
<abbr class="published" title="2014-09-14T00:00:00">
|
||||
So 14 September 2014
|
||||
</abbr>
|
||||
<address class="vcard author">
|
||||
By <a class="url fn" href="http://example.com/test/de/author/der-tester.html">Der Tester</a>
|
||||
</address>
|
||||
</footer><!-- /.post-info -->
|
||||
<div class="entry-content">
|
||||
<p>Ein einfacher Artikel mit einer Übersetzung.
|
||||
Hier ist ein Link zur <a class="reference external" href="http://example.com/test/de/../images/img.png">einigem Bild</a>.</p>
|
||||
|
||||
</div><!-- /.entry-content -->
|
||||
</section>
|
||||
<footer id="contentinfo" class="body">
|
||||
<address id="about" class="vcard body">
|
||||
Proudly powered by <a href="http://getpelican.com/">Pelican</a>,
|
||||
which takes great advantage of <a href="http://python.org">Python</a>.
|
||||
</address><!-- /#about -->
|
||||
</footer><!-- /#contentinfo -->
|
||||
</body>
|
||||
</html>
|
10
test_data/output/feeds_all.atom.xml
Normal file
10
test_data/output/feeds_all.atom.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom"><title>Testing site</title><link href="http://example.com/test/" rel="alternate"></link><link href="http://example.com/test/feeds_all.atom.xml" rel="self"></link><id>http://example.com/test/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/cz/translated-article.html" rel="alternate"></link><updated>2014-09-15T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-09-15:test/cz/translated-article.html</id><summary type="html"><p>Jednoduchý článek s překlady.
|
||||
Zde je odkaz na <a class="reference external" href="http://example.com/test/images/img.png">nějaký obrázek</a>.</p>
|
||||
</summary></entry><entry><title>Ein übersetzter Artikel</title><link href="http://example.com/test/de/translated-article.html" rel="alternate"></link><updated>2014-09-14T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-09-14:test/de/translated-article.html</id><summary type="html"><p>Ein einfacher Artikel mit einer Übersetzung.
|
||||
Hier ist ein Link zur <a class="reference external" href="http://example.com/test/images/img.png">einigem Bild</a>.</p>
|
||||
</summary></entry><entry><title>A translated article</title><link href="http://example.com/test/translated-article.html" rel="alternate"></link><updated>2014-09-13T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-09-13:test/translated-article.html</id><summary type="html"><p>A simple article with a translation.
|
||||
Here is a link to <a class="reference external" href="http://example.com/test/images/img.png">some image</a>.</p>
|
||||
</summary></entry><entry><title>An untranslated article</title><link href="http://example.com/test/an-untranslated-article.html" rel="alternate"></link><updated>2014-07-14T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-07-14:test/an-untranslated-article.html</id><summary type="html"><p>An article without a translation.
|
||||
Here is a link to an <a class="reference external" href="http://example.com/test/pages/untranslated-page.html">untranslated page</a></p>
|
||||
</summary></entry></feed>
|
0
test_data/output/images/img.png
Normal file
0
test_data/output/images/img.png
Normal file
55
test_data/output/index.html
Normal file
55
test_data/output/index.html
Normal file
@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Welcome to our Testing site</title>
|
||||
<meta charset="utf-8" />
|
||||
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" />
|
||||
|
||||
<link rel="stylesheet" href="http://example.com/test/theme/style.css" />
|
||||
</head>
|
||||
|
||||
<body id="index" class="home">
|
||||
<header id="banner" class="body">
|
||||
<h1><a href="http://example.com/test/">Testing site <strong></strong></a></h1>
|
||||
</header><!-- /#banner -->
|
||||
<nav id="menu"><ul>
|
||||
<li><a href="http://example.com/test/pages/untranslated-page.html">Untranslated page</a></li>
|
||||
</ul></nav><!-- /#menu -->
|
||||
<section id="content">
|
||||
<h2>All articles</h2>
|
||||
|
||||
<ol id="post-list">
|
||||
<li><article class="hentry">
|
||||
<header> <h2 class="entry-title"><a href="http://example.com/test/translated-article.html" rel="bookmark" title="Permalink to A translated article">A translated article</a></h2> </header>
|
||||
<footer class="post-info">
|
||||
<abbr class="published" title="2014-09-13T00:00:00"> Sat 13 September 2014 </abbr>
|
||||
<address class="vcard author">By
|
||||
<a class="url fn" href="http://example.com/test/author/the-tester.html">The Tester</a>
|
||||
</address>
|
||||
</footer><!-- /.post-info -->
|
||||
<div class="entry-content"> <p>A simple article with a translation.
|
||||
Here is a link to <a class="reference external" href="http://example.com/test/images/img.png">some image</a>.</p>
|
||||
</div><!-- /.entry-content -->
|
||||
</article></li>
|
||||
<li><article class="hentry">
|
||||
<header> <h2 class="entry-title"><a href="http://example.com/test/an-untranslated-article.html" rel="bookmark" title="Permalink to An untranslated article">An untranslated article</a></h2> </header>
|
||||
<footer class="post-info">
|
||||
<abbr class="published" title="2014-07-14T00:00:00"> Mon 14 July 2014 </abbr>
|
||||
<address class="vcard author">By
|
||||
<a class="url fn" href="http://example.com/test/author/the-tester.html">The Tester</a>
|
||||
</address>
|
||||
</footer><!-- /.post-info -->
|
||||
<div class="entry-content"> <p>An article without a translation.
|
||||
Here is a link to an <a class="reference external" href="http://example.com/test/pages/untranslated-page.html">untranslated page</a></p>
|
||||
</div><!-- /.entry-content -->
|
||||
</article></li>
|
||||
</ol><!-- /#posts-list -->
|
||||
</section><!-- /#content -->
|
||||
<footer id="contentinfo" class="body">
|
||||
<address id="about" class="vcard body">
|
||||
Proudly powered by <a href="http://getpelican.com/">Pelican</a>,
|
||||
which takes great advantage of <a href="http://python.org">Python</a>.
|
||||
</address><!-- /#about -->
|
||||
</footer><!-- /#contentinfo -->
|
||||
</body>
|
||||
</html>
|
31
test_data/output/pages/untranslated-page.html
Normal file
31
test_data/output/pages/untranslated-page.html
Normal file
@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Untranslated page</title>
|
||||
<meta charset="utf-8" />
|
||||
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" />
|
||||
|
||||
<link rel="stylesheet" href="http://example.com/test/theme/style.css" />
|
||||
</head>
|
||||
|
||||
<body id="index" class="home">
|
||||
<header id="banner" class="body">
|
||||
<h1><a href="http://example.com/test/">Testing site <strong></strong></a></h1>
|
||||
</header><!-- /#banner -->
|
||||
<nav id="menu"><ul>
|
||||
<li class="active"><a href="http://example.com/test/pages/untranslated-page.html">Untranslated page</a></li>
|
||||
</ul></nav><!-- /#menu -->
|
||||
<h1>Untranslated page</h1>
|
||||
|
||||
|
||||
<p>This page has no translation.</p>
|
||||
|
||||
|
||||
<footer id="contentinfo" class="body">
|
||||
<address id="about" class="vcard body">
|
||||
Proudly powered by <a href="http://getpelican.com/">Pelican</a>,
|
||||
which takes great advantage of <a href="http://python.org">Python</a>.
|
||||
</address><!-- /#about -->
|
||||
</footer><!-- /#contentinfo -->
|
||||
</body>
|
||||
</html>
|
0
test_data/output/theme/style.css
Normal file
0
test_data/output/theme/style.css
Normal file
53
test_data/output/translated-article.html
Normal file
53
test_data/output/translated-article.html
Normal file
@ -0,0 +1,53 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Welcome to our Testing site</title>
|
||||
<meta charset="utf-8" />
|
||||
<link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" />
|
||||
|
||||
<link rel="stylesheet" href="http://example.com/test/theme/style.css" />
|
||||
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body id="index" class="home">
|
||||
<header id="banner" class="body">
|
||||
<h1><a href="http://example.com/test/">Testing site <strong></strong></a></h1>
|
||||
</header><!-- /#banner -->
|
||||
<nav id="menu"><ul>
|
||||
<li><a href="http://example.com/test/pages/untranslated-page.html">Untranslated page</a></li>
|
||||
</ul></nav><!-- /#menu -->
|
||||
<section id="content" class="body">
|
||||
<header>
|
||||
<h2 class="entry-title">
|
||||
<a href="http://example.com/test/translated-article.html" rel="bookmark"
|
||||
title="Permalink to A translated article">A translated article</a></h2>
|
||||
Translations:
|
||||
<a href="http://example.com/test/cz/translated-article.html">cz</a>
|
||||
<a href="http://example.com/test/de/translated-article.html">de</a>
|
||||
|
||||
</header>
|
||||
<footer class="post-info">
|
||||
<abbr class="published" title="2014-09-13T00:00:00">
|
||||
Sat 13 September 2014
|
||||
</abbr>
|
||||
<address class="vcard author">
|
||||
By <a class="url fn" href="http://example.com/test/author/the-tester.html">The Tester</a>
|
||||
</address>
|
||||
</footer><!-- /.post-info -->
|
||||
<div class="entry-content">
|
||||
<p>A simple article with a translation.
|
||||
Here is a link to <a class="reference external" href="http://example.com/test/images/img.png">some image</a>.</p>
|
||||
|
||||
</div><!-- /.entry-content -->
|
||||
</section>
|
||||
<footer id="contentinfo" class="body">
|
||||
<address id="about" class="vcard body">
|
||||
Proudly powered by <a href="http://getpelican.com/">Pelican</a>,
|
||||
which takes great advantage of <a href="http://python.org">Python</a>.
|
||||
</address><!-- /#about -->
|
||||
</footer><!-- /#contentinfo -->
|
||||
</body>
|
||||
</html>
|
53
test_data/pelicanconf.py
Normal file
53
test_data/pelicanconf.py
Normal file
@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*- #
|
||||
from __future__ import unicode_literals
|
||||
|
||||
AUTHOR = 'The Tester'
|
||||
SITENAME = 'Testing site'
|
||||
SITEURL = 'http://example.com/test'
|
||||
|
||||
# to make the test suite portable
|
||||
TIMEZONE = 'UTC'
|
||||
|
||||
DEFAULT_LANG = 'en'
|
||||
LOCALE = 'en_US.UTF-8'
|
||||
|
||||
# Generate only one feed
|
||||
FEED_ALL_ATOM = 'feeds_all.atom.xml'
|
||||
CATEGORY_FEED_ATOM = None
|
||||
TRANSLATION_FEED_ATOM = None
|
||||
AUTHOR_FEED_ATOM = None
|
||||
AUTHOR_FEED_RSS = None
|
||||
|
||||
# Disable unnecessary pages
|
||||
CATEGORY_SAVE_AS = ''
|
||||
TAG_SAVE_AS = ''
|
||||
AUTHOR_SAVE_AS = ''
|
||||
ARCHIVES_SAVE_AS = ''
|
||||
AUTHORS_SAVE_AS = ''
|
||||
CATEGORIES_SAVE_AS = ''
|
||||
TAGS_SAVE_AS = ''
|
||||
|
||||
PLUGIN_PATHS = ['../../']
|
||||
PLUGINS = ['i18n_subsites']
|
||||
|
||||
THEME = 'localized_theme'
|
||||
JINJA_EXTENSIONS = ['jinja2.ext.i18n']
|
||||
|
||||
from blinker import signal
|
||||
tmpsig = signal('tmpsig')
|
||||
I18N_FILTER_SIGNALS = [tmpsig]
|
||||
|
||||
I18N_SUBSITES = {
|
||||
'de': {
|
||||
'SITENAME': 'Testseite',
|
||||
'AUTHOR': 'Der Tester',
|
||||
'LOCALE': 'de_DE.UTF-8',
|
||||
},
|
||||
'cz': {
|
||||
'SITENAME': 'Testovací stránka',
|
||||
'AUTHOR': 'Test Testovič',
|
||||
'I18N_UNTRANSLATED_PAGES': 'remove',
|
||||
'I18N_UNTRANSLATED_ARTICLES': 'keep',
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user