diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6174f19 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +help: + @echo 'Makefile for localization' + @echo '' + @echo 'Usage:' + @echo ' make extract Extract translatable strings from templates' + @echo ' make init lang=lang Initialize the message catalogs with a new language (e.g make init lang=ja)' + @echo ' make compile Compile the message catalogs' + @echo ' make update Update the catalogs when templates change' + +extract: + pybabel extract --mapping babel.cfg --output messages.pot ./ + +init: + pybabel init --input-file messages.pot --output-dir translations/ --locale $$lang --domain messages + +compile: + pybabel compile --directory translations/ --domain messages + +update: + pybabel update --input-file messages.pot --output-dir translations/ --domain messages + diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 0000000..2274808 --- /dev/null +++ b/babel.cfg @@ -0,0 +1 @@ +[jinja2: templates/**.html] diff --git a/messages.pot b/messages.pot new file mode 100644 index 0000000..191ff8e --- /dev/null +++ b/messages.pot @@ -0,0 +1,95 @@ +# Translations template for PROJECT. +# Copyright (C) 2017 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , 2017. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-04-06 06:29+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.3.4\n" + +#: templates/archives.html:3 +msgid "Archives" +msgstr "" + +#: templates/archives.html:18 +#, python-format +msgid "Archives for %(name)s" +msgstr "" + +#: templates/article.html:108 templates/index.html:61 +msgid "Posted by" +msgstr "" + +#: templates/article.html:112 templates/index.html:65 +msgid "on" +msgstr "" + +#: templates/article.html:115 +#, python-format +msgid "Updated on %(moddate)s" +msgstr "" + +#: templates/article.html:134 +msgid "tags" +msgstr "" + +#: templates/article.html:155 +msgid "Please enable JavaScript to view the comments." +msgstr "" + +#: templates/author.html:3 templates/author.html:7 templates/author.html:27 +#: templates/authors.html:18 +#, python-format +msgid "Articles by %(name)s" +msgstr "" + +#: templates/authors.html:3 +msgid "Authors" +msgstr "" + +#: templates/categories.html:3 templates/categories.html:18 +msgid "Categories" +msgstr "" + +#: templates/category.html:3 templates/category.html:18 +#, python-format +msgid "Articles in the %(category)s category" +msgstr "" + +#: templates/pagination.html:7 +msgid "Older Posts" +msgstr "" + +#: templates/pagination.html:10 +msgid "Newest Posts" +msgstr "" + +#: templates/period_archives.html:3 templates/period_archives.html:18 +#, python-format +msgid "Archives for %(period)s" +msgstr "" + +#: templates/tag.html:2 +#, python-format +msgid "Tag %(tag)s" +msgstr "" + +#: templates/tags.html:3 templates/tags.html:18 +msgid "Tags" +msgstr "" + +#: templates/tags.html:27 +#, python-format +msgid "Tags for %(sitename)s" +msgstr "" +