From 750e2116490750cccd2be2daf5e17d40ec0c1acb Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Mon, 20 Dec 2010 22:50:54 +0000 Subject: [PATCH] Update the documentations and fix some little things about the translation feature. --- docs/getting_started.rst | 8 ++++++++ docs/settings.rst | 4 ++++ pelican/contents.py | 2 +- pelican/settings.py | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index a6eaf79b..f66a6f06 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -87,3 +87,11 @@ generate static pages. Then, use the `DISPLAY_PAGES_ON_MENU` setting, which will add all the pages to the menu. + +Translations +============ + +It is possible to translate articles. To do so, you need to add a `Lang` meta +in your articles/pages, and to set a `DEFAULT_LANG` setting (which is en by +default). Then, only articles with this default language will be listed, and +each article will have a translation list. diff --git a/docs/settings.rst b/docs/settings.rst index b8eee542..e58243bc 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -31,6 +31,7 @@ Setting name what it does ? `CSS_FILE` To specify the CSS file you want to load, if it's not the default one ('main.css') `DEFAULT_CATEGORY` The default category to fallback on. `misc` by default. +`DEFAULT_LANG` The default language to use. Default is 'en'. `DISPLAY_PAGES_ON_MENU` Display or not the pages on the menu of the template. Templates can follow or not this settings. `FALLBACK_ON_FS_DATE` If True, pelican will use the file system dates infos @@ -62,6 +63,9 @@ Setting name what it does ? `THEME` theme to use to product the output. can be the complete static path to a theme folder, or chosen between the list of default themes (see below) +`TRANSLATION_FEED` Where to put the RSS feed for translations. Default + is feeds/all-%s.atom.xml where %s is the name of the + lang. ======================= ======================================================= Themes diff --git a/pelican/contents.py b/pelican/contents.py index 1ecced30..bb6949fb 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -22,7 +22,7 @@ class Page(object): if 'AUTHOR' in settings: self.author = settings['AUTHOR'] - default_lang = settings.get('DEFAULT_LANG', 'en').lower() + default_lang = settings.get('DEFAULT_LANG').lower() if not hasattr(self, 'lang'): self.lang = default_lang diff --git a/pelican/settings.py b/pelican/settings.py index dba11906..599f56ee 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -20,6 +20,7 @@ _DEFAULT_CONFIG = {'PATH': None, 'REVERSE_ARCHIVE_ORDER': False, 'KEEP_OUTPUT_DIRECTORY': False, 'CLEAN_URLS': False, # use /blah/ instead /blah.html in urls + 'DEFAULT_LANG': 'en', } def read_settings(filename):