From 7dadea51728d1bcb6e9f54f95ce5a5bcb22a098e Mon Sep 17 00:00:00 2001 From: "Leonardo J. Caballero G" Date: Sat, 1 Apr 2017 08:59:46 -0400 Subject: [PATCH] Added i18n support using Babel and Spanish translation --- MANIFEST.in | 5 + README.rst | 2 + babel.cfg | 10 ++ locale/es/LC_MESSAGES/sphinx.mo | Bin 0 -> 3438 bytes locale/es/LC_MESSAGES/sphinx.po | 190 ++++++++++++++++++++++++++++++++ locale/sphinx.pot | 170 ++++++++++++++++++++++++++++ setup.cfg | 20 ++++ setup.py | 10 ++ 8 files changed, 407 insertions(+) create mode 100644 babel.cfg create mode 100644 locale/es/LC_MESSAGES/sphinx.mo create mode 100644 locale/es/LC_MESSAGES/sphinx.po create mode 100644 locale/sphinx.pot diff --git a/MANIFEST.in b/MANIFEST.in index 1e6a2ebd3..f8e746404 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,9 @@ include *.txt +include babel.cfg include LICENSE +recursive-include locale *.mo +recursive-include locale *.pot +recursive-include locale *.po recursive-include sphinx_rtd_theme *.conf recursive-include sphinx_rtd_theme *.css recursive-include sphinx_rtd_theme *.eot @@ -9,3 +13,4 @@ recursive-include sphinx_rtd_theme *.svg recursive-include sphinx_rtd_theme *.ttf recursive-include sphinx_rtd_theme *.woff recursive-include sphinx_rtd_theme *.woff2 +prune build \ No newline at end of file diff --git a/README.rst b/README.rst index e45fab846..8b952af1f 100644 --- a/README.rst +++ b/README.rst @@ -105,6 +105,8 @@ Changelog master ------ +* Added Spanish translation +* Added i18n support using Babel * Include fontawesome-webfont.woff2 in pip package * Updated wyrm_ and Font Awesome * Split multiple data types on different lines diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 000000000..34f66b18e --- /dev/null +++ b/babel.cfg @@ -0,0 +1,10 @@ +# How setup this file +# http://babel.edgewall.org/wiki/Documentation/setup.html +# this file description: +# http://babel.edgewall.org/wiki/Documentation/messages.html#extraction-method-mapping-and-configuration + +# Extraction from Jinja2 HTML templates +[jinja2: **/**.html] +encoding = utf-8 +ignore_tags = script,style +include_attrs = alt title summary \ No newline at end of file diff --git a/locale/es/LC_MESSAGES/sphinx.mo b/locale/es/LC_MESSAGES/sphinx.mo new file mode 100644 index 0000000000000000000000000000000000000000..b9337464a2351dfdfbe10f12c166d085d394f8a0 GIT binary patch literal 3438 zcmcJR-)kL36vs!cRj*a5Rz$6I8mT7W-rU4c!_5zyUu`2v8gf&iPzbZTlfBdK-MO8a zy~!;IKKW4bL7||Jd90uaL7_qL;TC+8{slhxyEj4gt1gZN|DaH0MN_!9Uj_#*gKn_J)|w0{7f1`D{H1doCRa2UiRHUS<5r@>jU z0zM0V4ITlvK=S8%knH~mJ`dgj-vsZ1H2yD;?EC}X01so*E#%-!@DsGhFvtgQgQMVa zI8Sk31do9!NcL}lzk=U@_+tXjQruTT^7}R})PDzj1^f-9b^mDdZ!kvt5S)AlyatxQ zCP;pNiwpVt6G-!Z0hhqL?fw%8n(X$2w9YvA26z^vJPYtO(6*m{4!(uhU?23di( zf8(|;5+20D+KE0tRdLui*?q|QH1+Iij|*Nka($xjRDU*jEj96g?VId0RXAYB2gPKu zJ7;{5R_NF~VBtX5YRc_dc||sqRXXA0fes}W$j6ZRtmD8H-U)QQImUN+S{JTLPR`(g zQBl>Ahny_7+XJ@9+S9sY_CKHUb?UgQN-KG&gR~|SXIYk?9FA`&SM9A^b*^3>MD$ga zYw==eNHRqr@>X}x;^KVJD>Wyn+w8cXN~M-npd@Tl&k}TMbbs7N@3!Cwpu;mICD<0;d`< z!#@%YQ3;Hyqfj)LiST2Y<=RSNf@*tDtfvVk=tRWIHH&Q7pwe|}aig!u!143CCRrt$ z(FT^aX^e8qd#V1q_f&L>yr)j5Tr3AH`#66KxKVP0*F_|`)u{<2y9Dsu9UiKXC))9v za6y%eq}eO%B5%i56IU@eH57+%T*NWo&?dB8pv%@}9HU+WZ45k*n=nGfg@H|-zT3bE z8RG$l$V8`6l?O;uq>YkDZ#!OZKJ?oDmSK^0ORvs(sW@C5DXhr4HqKkLkqW)(G_u~R zF7vs?sriL7Q?s)xbCpVA`NFD~6);lk&0?K0A1)1j;FaF@hEMaMq4LOxR~jjmFwpB9 zF83KXS{^CoTl1DyLRqIZlm;y|dcXY?&wZtZ65P$9R4_(Vy^>6MSf(usFXs z*Gtz>u~eARiNjgstv2ge$e~aN>#cXImgs-46$UrPOsZK6Bp~%1J z5VzmjvDZ==iXxlBDPoj1Y`L`+sYFm(a6&h6d}}t{8OL%ZLMWC7z;4$BzJ=)J^y-{G zi?W_9$ot3>Y99wbulE)VTHB$DG@QjNf(WKP^H3^m4}~DGF71;9M^|en*|i=-YgbOJ z#AB0vu1Ss{A<3bza2fAd#KJeY!NzRe!sl, 2017. +# Leonardo Caballero , 2017. +msgid "" +msgstr "" +"Project-Id-Version: sphinx_rtd_theme 0.2.4\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-03-26 11:44-0400\n" +"PO-Revision-Date: 2017-03-26 18:40-0400\n" +"Last-Translator: Leonardo Caballero \n" +"Language-Team: Spanish Team\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Generated-By: Babel 2.4.0\n" + +#: sphinx_rtd_theme/breadcrumbs.html:31 +msgid "Docs" +msgstr "Documentos" + +#: sphinx_rtd_theme/breadcrumbs.html:43 sphinx_rtd_theme/breadcrumbs.html:45 +msgid "Edit on GitHub" +msgstr "Editar en GitHub" + +#: sphinx_rtd_theme/breadcrumbs.html:50 sphinx_rtd_theme/breadcrumbs.html:52 +msgid "Edit on Bitbucket" +msgstr "Editar en Bitbucket" + +#: sphinx_rtd_theme/breadcrumbs.html:57 sphinx_rtd_theme/breadcrumbs.html:59 +msgid "Edit on GitLab" +msgstr "Editar en GitLab" + +#: sphinx_rtd_theme/breadcrumbs.html:62 sphinx_rtd_theme/breadcrumbs.html:64 +msgid "View page source" +msgstr "Ver página de código fuente" + +#: sphinx_rtd_theme/footer.html:5 +msgid "Next" +msgstr "Próximo" + +#: sphinx_rtd_theme/footer.html:8 +msgid "Previous" +msgstr "Anterior" + +#: sphinx_rtd_theme/footer.html:19 sphinx_rtd_theme/layout_old.html:193 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Copyright %(copyright)s." + +#: sphinx_rtd_theme/footer.html:21 sphinx_rtd_theme/layout_old.html:195 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Copyright %(copyright)s." + +#: sphinx_rtd_theme/footer.html:26 +#, python-format +msgid "" +"\n" +" \n" +" Build\n" +" %(build_id)s.\n" +" \n" +" " +msgstr "" +"\n" +" \n" +" Construido\n" +" %(build_id)s.\n" +" \n" +" " + +#: sphinx_rtd_theme/footer.html:33 +#, python-format +msgid "" +"\n" +" \n" +" Revision %(commit)s.\n" +" \n" +" " +msgstr "" +"\n" +" \n" +" Revisión %(commit)s.\n" +" \n" +" " + +#: sphinx_rtd_theme/footer.html:39 sphinx_rtd_theme/layout_old.html:199 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Actualizado por última vez en %(last_updated)s." + +#: sphinx_rtd_theme/footer.html:46 +msgid "" +"Built with Sphinx using a theme provided by " +"Read the Docs" +msgstr "" +"Construido con Sphinx usando un tema proporcionado por " +"Read the Docs" + +#: sphinx_rtd_theme/layout.html:35 sphinx_rtd_theme/layout_old.html:123 +#, python-format +msgid "Search within %(docstitle)s" +msgstr "Buscar en %(docstitle)s" + +#: sphinx_rtd_theme/layout.html:55 sphinx_rtd_theme/layout_old.html:135 +msgid "About these documents" +msgstr "Sobre este documento" + +#: sphinx_rtd_theme/layout.html:59 sphinx_rtd_theme/layout_old.html:138 +msgid "Index" +msgstr "Índice" + +#: sphinx_rtd_theme/layout.html:63 sphinx_rtd_theme/layout_old.html:141 +#: sphinx_rtd_theme/search.html:11 +msgid "Search" +msgstr "Búsqueda" + +#: sphinx_rtd_theme/layout.html:66 sphinx_rtd_theme/layout_old.html:144 +msgid "Copyright" +msgstr "Copyright" + +#: sphinx_rtd_theme/layout_old.html:29 +msgid "Navigation" +msgstr "Navegación" + +#: sphinx_rtd_theme/layout_old.html:202 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Creado usando Sphinx " +"%(sphinx_version)s." + +#: sphinx_rtd_theme/search.html:26 +msgid "" +"Please activate JavaScript to enable the search\n" +" functionality." +msgstr "" +"Por favor, active JavaScript para habilitar la funcionalidad\n" +" de búsqueda." + +#: sphinx_rtd_theme/search.html:33 +msgid "Search Results" +msgstr "Resultados de la búsqueda" + +#: sphinx_rtd_theme/search.html:35 +msgid "" +"Your search did not match any documents. Please make sure that all words " +"are spelled correctly and that you've selected enough categories." +msgstr "Su búsqueda no coincide con ningún documentos. Por favor, asegúrese de que todas las palabras estén correctamente escritas y que usted allá seleccionado las suficientes categorías." + +#: sphinx_rtd_theme/searchbox.html:4 +msgid "Search docs" +msgstr "Buscar documentos" + +#: sphinx_rtd_theme/versions.html:11 +msgid "Versions" +msgstr "Versiones" + +#: sphinx_rtd_theme/versions.html:17 +msgid "Downloads" +msgstr "Descargas" + +#: sphinx_rtd_theme/versions.html:23 +msgid "On Read the Docs" +msgstr "En Read the Docs" + +#: sphinx_rtd_theme/versions.html:25 +msgid "Project Home" +msgstr "Página de Proyecto" + +#: sphinx_rtd_theme/versions.html:28 +msgid "Builds" +msgstr "Construcciones" + +#: sphinx_rtd_theme/versions.html:32 +msgid "" +"Free document hosting provided by Read the Docs." +msgstr "" +"Alojamiento gratuito de documentos proporcionado por Read the Docs." diff --git a/locale/sphinx.pot b/locale/sphinx.pot new file mode 100644 index 000000000..502c5a9fc --- /dev/null +++ b/locale/sphinx.pot @@ -0,0 +1,170 @@ +# Translations template for sphinx_rtd_theme. +# Copyright (C) 2017 ORGANIZATION +# This file is distributed under the same license as the sphinx_rtd_theme +# project. +# FIRST AUTHOR , 2017. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: sphinx_rtd_theme 0.2.4\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-03-26 11:44-0400\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.4.0\n" + +#: sphinx_rtd_theme/breadcrumbs.html:31 +msgid "Docs" +msgstr "" + +#: sphinx_rtd_theme/breadcrumbs.html:43 sphinx_rtd_theme/breadcrumbs.html:45 +msgid "Edit on GitHub" +msgstr "" + +#: sphinx_rtd_theme/breadcrumbs.html:50 sphinx_rtd_theme/breadcrumbs.html:52 +msgid "Edit on Bitbucket" +msgstr "" + +#: sphinx_rtd_theme/breadcrumbs.html:57 sphinx_rtd_theme/breadcrumbs.html:59 +msgid "Edit on GitLab" +msgstr "" + +#: sphinx_rtd_theme/breadcrumbs.html:62 sphinx_rtd_theme/breadcrumbs.html:64 +msgid "View page source" +msgstr "" + +#: sphinx_rtd_theme/footer.html:5 +msgid "Next" +msgstr "" + +#: sphinx_rtd_theme/footer.html:8 +msgid "Previous" +msgstr "" + +#: sphinx_rtd_theme/footer.html:19 sphinx_rtd_theme/layout_old.html:193 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "" + +#: sphinx_rtd_theme/footer.html:21 sphinx_rtd_theme/layout_old.html:195 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "" + +#: sphinx_rtd_theme/footer.html:26 +#, python-format +msgid "" +"\n" +" \n" +" Build\n" +" %(build_id)s.\n" +" \n" +" " +msgstr "" + +#: sphinx_rtd_theme/footer.html:33 +#, python-format +msgid "" +"\n" +" \n" +" Revision %(commit)s.\n" +" \n" +" " +msgstr "" + +#: sphinx_rtd_theme/footer.html:39 sphinx_rtd_theme/layout_old.html:199 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "" + +#: sphinx_rtd_theme/footer.html:46 +msgid "" +"Built with Sphinx using a theme provided by " +"Read the Docs" +msgstr "" + +#: sphinx_rtd_theme/layout.html:35 sphinx_rtd_theme/layout_old.html:123 +#, python-format +msgid "Search within %(docstitle)s" +msgstr "" + +#: sphinx_rtd_theme/layout.html:55 sphinx_rtd_theme/layout_old.html:135 +msgid "About these documents" +msgstr "" + +#: sphinx_rtd_theme/layout.html:59 sphinx_rtd_theme/layout_old.html:138 +msgid "Index" +msgstr "" + +#: sphinx_rtd_theme/layout.html:63 sphinx_rtd_theme/layout_old.html:141 +#: sphinx_rtd_theme/search.html:11 +msgid "Search" +msgstr "" + +#: sphinx_rtd_theme/layout.html:66 sphinx_rtd_theme/layout_old.html:144 +msgid "Copyright" +msgstr "" + +#: sphinx_rtd_theme/layout_old.html:29 +msgid "Navigation" +msgstr "" + +#: sphinx_rtd_theme/layout_old.html:202 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" + +#: sphinx_rtd_theme/search.html:26 +msgid "" +"Please activate JavaScript to enable the search\n" +" functionality." +msgstr "" + +#: sphinx_rtd_theme/search.html:33 +msgid "Search Results" +msgstr "" + +#: sphinx_rtd_theme/search.html:35 +msgid "" +"Your search did not match any documents. Please make sure that all words " +"are spelled correctly and that you've selected enough categories." +msgstr "" + +#: sphinx_rtd_theme/searchbox.html:4 +msgid "Search docs" +msgstr "" + +#: sphinx_rtd_theme/versions.html:11 +msgid "Versions" +msgstr "" + +#: sphinx_rtd_theme/versions.html:17 +msgid "Downloads" +msgstr "" + +#: sphinx_rtd_theme/versions.html:23 +msgid "On Read the Docs" +msgstr "" + +#: sphinx_rtd_theme/versions.html:25 +msgid "Project Home" +msgstr "" + +#: sphinx_rtd_theme/versions.html:28 +msgid "Builds" +msgstr "" + +#: sphinx_rtd_theme/versions.html:32 +msgid "" +"Free document hosting provided by Read the Docs." +msgstr "" + diff --git a/setup.cfg b/setup.cfg index 2a9acf13d..fe2f3e46b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,22 @@ [bdist_wheel] universal = 1 + +# How setup this file for babel configurations +# http://babel.pocoo.org/en/latest/setup.html +[compile_catalog] +domain = sphinx +directory = locale/ + +[extract_messages] +mapping_file = babel.cfg +output_file = locale/sphinx.pot +keywords = _ l_ lazy_gettext + +[init_catalog] +input_file = locale/sphinx.pot +output_file = locale/$LANG/LC_MESSAGES/sphinx.po + +[update_catalog] +domain = sphinx +input_file = locale/sphinx.pot +output_dir = locale/ diff --git a/setup.py b/setup.py index e6c0a69fb..5763e2283 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,7 @@ .. _github: https://www.github.com/snide/sphinx_rtd_theme """ +from babel.messages import frontend as babel from setuptools import setup from sphinx_rtd_theme import __version__ @@ -43,4 +44,13 @@ 'Topic :: Documentation', 'Topic :: Software Development :: Documentation', ], + install_requires= [ + 'Sphinx>=1.4.1', + ], + cmdclass = { + 'compile_catalog': babel.compile_catalog, + 'extract_messages': babel.extract_messages, + 'init_catalog': babel.init_catalog, + 'update_catalog': babel.update_catalog + }, )