diff --git a/docs/contributing.rst b/docs/contributing.rst index d4b06ea..ab6dc57 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -83,7 +83,7 @@ the following: .. code:: console - npm run i18n + python setup.py i18n This will extract new messages, upload the messages to Transifex, and will update our local translation files. Changes can be checked in to a branch and @@ -100,7 +100,7 @@ To release a new version of the theme, core team will take the following steps: we try to follow `semver `_, so be careful with breaking changes. #. Update the changelog (``docs/changelog.rst``) with the version information. #. Run ``grunt build`` to rebuild all the theme assets. -#. Run ``npm run i18n`` to compile new translation files and update Transifex +#. Run ``python setup.py i18n`` to compile new translation files and update Transifex #. Commit that change. #. Tag the release in git: ``git tag $NEW_VERSION``. #. Push the tag to GitHub: ``git push --tags origin``. diff --git a/package.json b/package.json index 0f128a9..3db297b 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,6 @@ "main": "js/theme.js", "version": "0.4.3", "private": true, - "scripts": { - "i18n-extract": "python setup.py extract_messages && python setup.py update_catalog", - "i18n-update": "tx pull && tx push --source", - "i18n-compile": "python setup.py compile_catalog", - "i18n": "npm run i18n-extract && npm run i18n-update && npm run i18n-compile" - }, "devDependencies": { "bower": "^1.8.4", "browserify": "^13.0.0", diff --git a/setup.py b/setup.py index eb40fcc..b7f33bf 100644 --- a/setup.py +++ b/setup.py @@ -4,11 +4,55 @@ .. _github: https://github.com/rtfd/sphinx_rtd_theme """ + +import subprocess +import distutils.cmd from io import open from setuptools import setup + from sphinx_rtd_theme import __version__ +class LocalizeCommand(distutils.cmd.Command): + + description = "Run all localization commands" + + user_options = [] + sub_commands = [ + ('extract_messages', None), + ('update_catalog', None), + ('transifex', None), + ('compile_catalog', None), + ] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + for cmd_name in self.get_sub_commands(): + self.run_command(cmd_name) + + +class TransifexCommand(distutils.cmd.Command): + + description = "Update translation files through Transifex" + + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + subprocess.run(['tx', 'push', '--source']) + subprocess.run(['tx', 'pull']) + + setup( name='sphinx_rtd_theme', version=__version__, @@ -18,6 +62,10 @@ setup( author_email='dev@readthedocs.org', description='Read the Docs theme for Sphinx', long_description=open('README.rst', encoding='utf-8').read(), + cmdclass={ + 'i18n': LocalizeCommand, + 'transifex': TransifexCommand, + }, zip_safe=False, packages=['sphinx_rtd_theme'], package_data={'sphinx_rtd_theme': [ @@ -44,6 +92,7 @@ setup( ], 'docs': [ 'sphinxcontrib-httpdomain', + 'sphinx_rtd_theme==0.4.3', ] }, classifiers=[ diff --git a/sphinx_rtd_theme/footer.html b/sphinx_rtd_theme/footer.html index 8895788..edbd8f7 100644 --- a/sphinx_rtd_theme/footer.html +++ b/sphinx_rtd_theme/footer.html @@ -26,7 +26,8 @@ {%- endif %} {%- if build_id and build_url %} - + z + {# Translators: Build is a noun, not a verb #} {% trans %}Build{% endtrans %} {{ build_id }}. diff --git a/sphinx_rtd_theme/locale/en/LC_MESSAGES/sphinx.mo b/sphinx_rtd_theme/locale/en/LC_MESSAGES/sphinx.mo index 13d0ea7..09d02ad 100644 Binary files a/sphinx_rtd_theme/locale/en/LC_MESSAGES/sphinx.mo and b/sphinx_rtd_theme/locale/en/LC_MESSAGES/sphinx.mo differ diff --git a/sphinx_rtd_theme/locale/en/LC_MESSAGES/sphinx.po b/sphinx_rtd_theme/locale/en/LC_MESSAGES/sphinx.po index 5fdd986..62ef526 100644 --- a/sphinx_rtd_theme/locale/en/LC_MESSAGES/sphinx.po +++ b/sphinx_rtd_theme/locale/en/LC_MESSAGES/sphinx.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: sphinx_rtd_theme 0.4.3.dev0\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2019-07-19 12:53-0600\n" +"POT-Creation-Date: 2019-07-24 17:44-0600\n" "PO-Revision-Date: 2019-07-16 15:43-0600\n" "Last-Translator: FULL NAME \n" "Language: en\n" diff --git a/sphinx_rtd_theme/locale/es/LC_MESSAGES/sphinx.mo b/sphinx_rtd_theme/locale/es/LC_MESSAGES/sphinx.mo index 2a25e1a..47cee53 100644 Binary files a/sphinx_rtd_theme/locale/es/LC_MESSAGES/sphinx.mo and b/sphinx_rtd_theme/locale/es/LC_MESSAGES/sphinx.mo differ diff --git a/sphinx_rtd_theme/locale/es/LC_MESSAGES/sphinx.po b/sphinx_rtd_theme/locale/es/LC_MESSAGES/sphinx.po index 4c42b67..d6f38b8 100644 --- a/sphinx_rtd_theme/locale/es/LC_MESSAGES/sphinx.po +++ b/sphinx_rtd_theme/locale/es/LC_MESSAGES/sphinx.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: sphinx_rtd_theme 0.4.3.dev0\n" "Report-Msgid-Bugs-To: support@readthedocs.org\n" -"POT-Creation-Date: 2019-07-19 12:53-0600\n" +"POT-Creation-Date: 2019-07-24 17:44-0600\n" "PO-Revision-Date: 2019-07-16 21:44+0000\n" "Last-Translator: Anthony , 2019\n" "Language: es\n" diff --git a/sphinx_rtd_theme/locale/nl/LC_MESSAGES/sphinx.mo b/sphinx_rtd_theme/locale/nl/LC_MESSAGES/sphinx.mo index 36054bb..64b2376 100644 Binary files a/sphinx_rtd_theme/locale/nl/LC_MESSAGES/sphinx.mo and b/sphinx_rtd_theme/locale/nl/LC_MESSAGES/sphinx.mo differ diff --git a/sphinx_rtd_theme/locale/nl/LC_MESSAGES/sphinx.po b/sphinx_rtd_theme/locale/nl/LC_MESSAGES/sphinx.po index 19e5b3f..097fac7 100644 --- a/sphinx_rtd_theme/locale/nl/LC_MESSAGES/sphinx.po +++ b/sphinx_rtd_theme/locale/nl/LC_MESSAGES/sphinx.po @@ -1,18 +1,21 @@ -# Dutch translations for sphinx_rtd_theme. +# English translations for sphinx_rtd_theme. # Copyright (C) 2019 ORGANIZATION # This file is distributed under the same license as the sphinx_rtd_theme # project. # FIRST AUTHOR , 2019. # +# Translators: +# Jesse Tan, 2019 msgid "" msgstr "" "Project-Id-Version: sphinx_rtd_theme 0.4.3.dev0\n" -"Report-Msgid-Bugs-To: support@readthedocs.org\n" -"POT-Creation-Date: 2019-07-19 12:53-0600\n" -"PO-Revision-Date: 2019-07-19 12:50-0600\n" -"Last-Translator: FULL NAME \n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2019-07-24 17:44-0600\n" +"PO-Revision-Date: 2019-07-16 21:44+0000\n" +"Last-Translator: Jesse Tan, 2019\n" "Language: nl\n" -"Language-Team: nl \n" +"Language-Team: Dutch " +"(https://www.transifex.com/readthedocs/teams/101354/nl/)\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" @@ -21,125 +24,127 @@ msgstr "" #: sphinx_rtd_theme/breadcrumbs.html:31 msgid "Docs" -msgstr "" +msgstr "Documentatie" #: sphinx_rtd_theme/breadcrumbs.html:43 sphinx_rtd_theme/breadcrumbs.html:45 msgid "Edit on GitHub" -msgstr "" +msgstr "Bewerk op GitHub" #: sphinx_rtd_theme/breadcrumbs.html:50 sphinx_rtd_theme/breadcrumbs.html:52 msgid "Edit on Bitbucket" -msgstr "" +msgstr "Bewerk op BitBucket" #: sphinx_rtd_theme/breadcrumbs.html:57 sphinx_rtd_theme/breadcrumbs.html:59 msgid "Edit on GitLab" -msgstr "" +msgstr "Bewerk op GitLab" #: sphinx_rtd_theme/breadcrumbs.html:62 sphinx_rtd_theme/breadcrumbs.html:64 msgid "View page source" -msgstr "" +msgstr "Bekijk paginabron" #: sphinx_rtd_theme/breadcrumbs.html:74 sphinx_rtd_theme/footer.html:5 msgid "Next" -msgstr "" +msgstr "Volgende" #: sphinx_rtd_theme/breadcrumbs.html:77 sphinx_rtd_theme/footer.html:8 msgid "Previous" -msgstr "" +msgstr "Vorige" #: sphinx_rtd_theme/footer.html:21 sphinx_rtd_theme/footer.html:24 #: sphinx_rtd_theme/layout.html:92 msgid "Copyright" -msgstr "" +msgstr "Copyright" #: sphinx_rtd_theme/footer.html:30 msgid "Build" -msgstr "" +msgstr "Bouwsel" #: sphinx_rtd_theme/footer.html:35 msgid "Revision" -msgstr "" +msgstr "Revisie" #: sphinx_rtd_theme/footer.html:39 #, python-format msgid "Last updated on %(last_updated)s." -msgstr "" +msgstr "Laatste update op %(last_updated)s." #: sphinx_rtd_theme/footer.html:49 #, python-format msgid "Built with %(sphinx_web)s using a" -msgstr "" +msgstr "Gebouwd met %(sphinx_web)s met een" #: sphinx_rtd_theme/footer.html:49 msgid "theme" -msgstr "" +msgstr "thema" #: sphinx_rtd_theme/footer.html:49 #, python-format msgid "provided by %(readthedocs_web)s" -msgstr "" +msgstr "geleverd door %(readthedocs_web)s" #: sphinx_rtd_theme/layout.html:61 #, python-format msgid "Search within %(docstitle)s" -msgstr "" +msgstr "Zoek binnen %(docstitle)s" #: sphinx_rtd_theme/layout.html:83 msgid "About these documents" -msgstr "" +msgstr "Over deze documenten" #: sphinx_rtd_theme/layout.html:86 msgid "Index" -msgstr "" +msgstr "Index" #: sphinx_rtd_theme/layout.html:89 sphinx_rtd_theme/search.html:11 msgid "Search" -msgstr "" +msgstr "Zoek" #: sphinx_rtd_theme/layout.html:124 msgid "Logo" -msgstr "" +msgstr "Logo" #: sphinx_rtd_theme/search.html:26 msgid "Please activate JavaScript to enable the search functionality." -msgstr "" +msgstr "Zet JavaScript aan om de zoekfunctie mogelijk te maken." #: sphinx_rtd_theme/search.html:33 msgid "Search Results" -msgstr "" +msgstr "Zoekresultaten" #: 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 "" +"Zoekpoging vond geen documenten. Zorg ervoor dat alle woorden correct " +"zijn gespeld en dat voldoende categorieën zijn geselecteerd." #: sphinx_rtd_theme/searchbox.html:4 msgid "Search docs" -msgstr "" +msgstr "Zoek in documentatie" #: sphinx_rtd_theme/versions.html:11 msgid "Versions" -msgstr "" +msgstr "Versies" #: sphinx_rtd_theme/versions.html:17 msgid "Downloads" -msgstr "" +msgstr "Downloads" #. The phrase "Read the Docs" is not translated #: sphinx_rtd_theme/versions.html:24 msgid "On Read the Docs" -msgstr "" +msgstr "Op Read the Docs" #: sphinx_rtd_theme/versions.html:26 msgid "Project Home" -msgstr "" +msgstr "Project Home" #: sphinx_rtd_theme/versions.html:29 msgid "Builds" -msgstr "" +msgstr "Bouwsels" #: sphinx_rtd_theme/versions.html:33 msgid "Free document hosting provided by" -msgstr "" +msgstr "Gratis hosting voor documentatie verzorgd door" diff --git a/sphinx_rtd_theme/locale/ru/LC_MESSAGES/sphinx.mo b/sphinx_rtd_theme/locale/ru/LC_MESSAGES/sphinx.mo index 85763b6..aa8022e 100644 Binary files a/sphinx_rtd_theme/locale/ru/LC_MESSAGES/sphinx.mo and b/sphinx_rtd_theme/locale/ru/LC_MESSAGES/sphinx.mo differ diff --git a/sphinx_rtd_theme/locale/ru/LC_MESSAGES/sphinx.po b/sphinx_rtd_theme/locale/ru/LC_MESSAGES/sphinx.po index dce819c..96e9bfd 100644 --- a/sphinx_rtd_theme/locale/ru/LC_MESSAGES/sphinx.po +++ b/sphinx_rtd_theme/locale/ru/LC_MESSAGES/sphinx.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: sphinx_rtd_theme 0.4.3.dev0\n" "Report-Msgid-Bugs-To: support@readthedocs.org\n" -"POT-Creation-Date: 2019-07-19 12:53-0600\n" +"POT-Creation-Date: 2019-07-24 17:44-0600\n" "PO-Revision-Date: 2019-07-16 21:44+0000\n" "Last-Translator: FULL NAME \n" "Language: ru\n" diff --git a/sphinx_rtd_theme/locale/sphinx.pot b/sphinx_rtd_theme/locale/sphinx.pot index 03844dc..4cf77f0 100644 --- a/sphinx_rtd_theme/locale/sphinx.pot +++ b/sphinx_rtd_theme/locale/sphinx.pot @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: sphinx_rtd_theme 0.4.3.dev0\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2019-07-19 12:53-0600\n" +"POT-Creation-Date: 2019-07-24 17:44-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/sphinx_rtd_theme/search.html b/sphinx_rtd_theme/search.html index 16bef01..252be24 100644 --- a/sphinx_rtd_theme/search.html +++ b/sphinx_rtd_theme/search.html @@ -30,6 +30,7 @@ {% if search_performed %} + {# Translators: Search is a noun, not a verb #}

{{ _('Search Results') }}

{% if not search_results %}

{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}