diff --git a/ablog/__init__.py b/ablog/__init__.py index d936f042..e3e6c80d 100755 --- a/ablog/__init__.py +++ b/ablog/__init__.py @@ -8,6 +8,7 @@ from sphinx.builders.html import StandaloneHTMLBuilder from sphinx.jinja2glue import BuiltinTemplateLoader, SphinxFileSystemLoader +from sphinx.locale import get_translation from .blog import CONFIG, Blog from .post import ( @@ -27,6 +28,9 @@ PKGDIR = os.path.abspath(os.path.dirname(__file__)) +# name used for the *.pot, *.po and *.mo files +MESSAGE_CATALOG_NAME = "sphinx" +_ = get_translation(MESSAGE_CATALOG_NAME) __all__ = ["setup"] @@ -148,5 +152,5 @@ def setup(app): ) pkgdir = os.path.abspath(os.path.dirname(__file__)) locale_dir = os.path.join(pkgdir, "locales") - app.config.locale_dirs.append(locale_dir) + app.add_message_catalog(MESSAGE_CATALOG_NAME, locale_dir) return {"version": __version__} # identifies the version of our extension diff --git a/ablog/locales/pt/LC_MESSAGES/sphinx.mo b/ablog/locales/pt/LC_MESSAGES/sphinx.mo new file mode 100644 index 00000000..2e7edf84 Binary files /dev/null and b/ablog/locales/pt/LC_MESSAGES/sphinx.mo differ diff --git a/ablog/locales/pt/LC_MESSAGES/sphinx.po b/ablog/locales/pt/LC_MESSAGES/sphinx.po new file mode 100644 index 00000000..bbba1309 --- /dev/null +++ b/ablog/locales/pt/LC_MESSAGES/sphinx.po @@ -0,0 +1,129 @@ +# Portuguese translations for ablog. +# Copyright (C) 2022 ORGANIZATION +# This file is distributed under the same license as the ablog project. +# Luís Henriques , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: ablog 0.10.30.dev7+g9a43710e3a7d\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2022-10-02 20:41+0100\n" +"PO-Revision-Date: 2022-10-02 20:41+0100\n" +"Last-Translator: Luís Henriques \n" +"Language: pt\n" +"Language-Team: pt \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.10.3\n" + +#: ablog/post.py:271 +msgid "Updated on " +msgstr "Actualizado em " + +#: ablog/post.py:563 ablog/templates/ablog/authors.html:3 +#: ablog/templates/authors.html:4 +msgid "Authors" +msgstr "Autores" + +#: ablog/post.py:563 ablog/post.py:630 +msgid "Posts by" +msgstr "Entradas por" + +#: ablog/post.py:564 ablog/templates/ablog/locations.html:4 +#: ablog/templates/locations.html:5 +msgid "Locations" +msgstr "Localizações" + +#: ablog/post.py:564 ablog/post.py:631 +msgid "Posts from" +msgstr "Entradas de" + +#: ablog/post.py:565 ablog/templates/ablog/languages.html:4 +#: ablog/templates/languages.html:5 +msgid "Languages" +msgstr "Linguagens" + +#: ablog/post.py:565 ablog/post.py:566 ablog/post.py:632 ablog/post.py:633 +msgid "Posts in" +msgstr "Entradas em" + +#: ablog/post.py:566 ablog/templates/ablog/categories.html:4 +#: ablog/templates/categories.html:5 +msgid "Categories" +msgstr "Categorias" + +#: ablog/post.py:567 +msgid "All posts" +msgstr "Todas as entradas" + +#: ablog/post.py:567 ablog/post.py:634 +msgid "Posted in" +msgstr "Publicado em" + +#: ablog/post.py:568 ablog/templates/ablog/postcard2.html:117 +#: ablog/templates/ablog/tagcloud.html:3 ablog/templates/postcard2.html:118 +#: ablog/templates/tagcloud.html:4 +msgid "Tags" +msgstr "Etiquetas" + +#: ablog/post.py:568 ablog/post.py:635 +msgid "Posts tagged" +msgstr "Entradas com etiqueta" + +#: ablog/post.py:593 +msgid "All Posts" +msgstr "Todas as Entradas" + +#: ablog/post.py:594 +msgid "All" +msgstr "Todas" + +#: ablog/post.py:602 +msgid "Drafts" +msgstr "Rascunhos" + +#: ablog/templates/ablog/archives.html:4 ablog/templates/archives.html:5 +msgid "Archives" +msgstr "Arquivos" + +#: ablog/templates/ablog/collection.html:56 ablog/templates/collection.html:57 +msgid "Read more ..." +msgstr "Ler mais ..." + +#: ablog/templates/ablog/postcard2.html:8 ablog/templates/postcard2.html:9 +msgid "Update" +msgstr "Actualizado" + +#: ablog/templates/ablog/postcard2.html:20 ablog/templates/postcard2.html:21 +msgid "Author" +msgstr "Autor" + +#: ablog/templates/ablog/postcard2.html:44 ablog/templates/postcard2.html:45 +msgid "Location" +msgstr "Localização" + +#: ablog/templates/ablog/postcard2.html:68 ablog/templates/postcard2.html:69 +msgid "Language" +msgstr "Idioma" + +#: ablog/templates/ablog/postcard2.html:92 ablog/templates/postcard2.html:93 +msgid "Category" +msgstr "Categoria" + +#: ablog/templates/ablog/postcard2.html:123 ablog/templates/postcard2.html:124 +msgid "Tag" +msgstr "Etiqueta" + +#: ablog/templates/ablog/postnavy.html:8 ablog/templates/postnavy.html:9 +msgid "Previous" +msgstr "Anterior" + +#: ablog/templates/ablog/postnavy.html:22 ablog/templates/postnavy.html:23 +msgid "Next" +msgstr "Próximo" + +#: ablog/templates/ablog/recentposts.html:4 ablog/templates/recentposts.html:5 +msgid "Recent Posts" +msgstr "Entradas Recentes" diff --git a/docs/manual/ablog-i18n.rst b/docs/manual/ablog-i18n.rst index 9b975bff..913213e2 100644 --- a/docs/manual/ablog-i18n.rst +++ b/docs/manual/ablog-i18n.rst @@ -18,10 +18,10 @@ Translation process involves the following steps: Execute extract_messages_ each time a translatable message text is changed or added:: - $ python setup.py extract_messages -o ablog/locale/sphinx.pot + $ python setup.py extract_messages -o ablog/locales/sphinx.pot ... - This will create or update :file:`ablog/locale/sphinx.pot` file, the central messages catalog used by the different translations. + This will create or update :file:`ablog/locales/sphinx.pot` file, the central messages catalog used by the different translations. 2. @@ -29,23 +29,23 @@ Translation process involves the following steps: Execute init_catalog_ once for each *new* language, e.g.:: - $ python setup.py init_catalog -l de -i ablog/locale/sphinx.pot -o ablog/locale/de/LC_MESSAGES/sphinx.po + $ python setup.py init_catalog -l de -i ablog/locales/sphinx.pot -o ablog/locales/de/LC_MESSAGES/sphinx.po - This will create a file :file:`ablog/locale/de/LC_MESSAGES/sphinx.po` in which translations needs to be placed. + This will create a file :file:`ablog/locales/de/LC_MESSAGES/sphinx.po` in which translations needs to be placed. b. Update translation catalog: Execute update_catalog_ for each *existing* language, e.g.:: - $ python setup.py update_catalog -l de -i ablog/locale/sphinx.pot -o ablog/locale/de/LC_MESSAGES/sphinx.po + $ python setup.py update_catalog -l de -i ablog/locales/sphinx.pot -o ablog/locales/de/LC_MESSAGES/sphinx.po - This will update file :file:`ablog/locale/de/LC_MESSAGES/sphinx.po` where translations of new text needs to be placed. + This will update file :file:`ablog/locales/de/LC_MESSAGES/sphinx.po` where translations of new text needs to be placed. 3. Compile catalogs: Execute compile_catalog_ for each existing language, e.g:: - $ python setup.py compile_catalog --directory ablog/locale/ --domain sphinx --locale de + $ python setup.py compile_catalog --directory ablog/locales/ --domain sphinx --locale de .. _extract_messages: http://babel.edgewall.org/wiki/Documentation/setup.html#extract-messages .. _init_catalog: http://babel.edgewall.org/wiki/Documentation/setup.html#init-catalog diff --git a/docs/release/ablog-v0.10-released.rst b/docs/release/ablog-v0.10-released.rst index 4b2f3b6a..81e98ebd 100644 --- a/docs/release/ablog-v0.10-released.rst +++ b/docs/release/ablog-v0.10-released.rst @@ -392,3 +392,4 @@ ABlog v0.10.30 released Pull Requests merged in: `Sort Feed posts by date `__. +`Fix sidebars ablog translations `__.