Skip to content

Commit 715c0be

Browse files
committed
Add commands into setup.py and regenerate translations
More fixes for docs
1 parent d216dcf commit 715c0be

File tree

14 files changed

+97
-47
lines changed

14 files changed

+97
-47
lines changed

docs/contributing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ the following:
8383

8484
.. code:: console
8585
86-
npm run i18n
86+
python setup.py i18n
8787
8888
This will extract new messages, upload the messages to Transifex, and will
8989
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:
100100
we try to follow `semver <http://semver.org/>`_, so be careful with breaking changes.
101101
#. Update the changelog (``docs/changelog.rst``) with the version information.
102102
#. Run ``grunt build`` to rebuild all the theme assets.
103-
#. Run ``npm run i18n`` to compile new translation files and update Transifex
103+
#. Run ``python setup.py i18n`` to compile new translation files and update Transifex
104104
#. Commit that change.
105105
#. Tag the release in git: ``git tag $NEW_VERSION``.
106106
#. Push the tag to GitHub: ``git push --tags origin``.

package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
"main": "js/theme.js",
44
"version": "0.4.3",
55
"private": true,
6-
"scripts": {
7-
"i18n-extract": "python setup.py extract_messages && python setup.py update_catalog",
8-
"i18n-update": "tx pull && tx push --source",
9-
"i18n-compile": "python setup.py compile_catalog",
10-
"i18n": "npm run i18n-extract && npm run i18n-update && npm run i18n-compile"
11-
},
126
"devDependencies": {
137
"bower": "^1.8.4",
148
"browserify": "^13.0.0",

setup.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,55 @@
44
.. _github: https://github.com/rtfd/sphinx_rtd_theme
55
66
"""
7+
8+
import subprocess
9+
import distutils.cmd
710
from io import open
811
from setuptools import setup
12+
913
from sphinx_rtd_theme import __version__
1014

1115

16+
class LocalizeCommand(distutils.cmd.Command):
17+
18+
description = "Run all localization commands"
19+
20+
user_options = []
21+
sub_commands = [
22+
('extract_messages', None),
23+
('update_catalog', None),
24+
('transifex', None),
25+
('compile_catalog', None),
26+
]
27+
28+
def initialize_options(self):
29+
pass
30+
31+
def finalize_options(self):
32+
pass
33+
34+
def run(self):
35+
for cmd_name in self.get_sub_commands():
36+
self.run_command(cmd_name)
37+
38+
39+
class TransifexCommand(distutils.cmd.Command):
40+
41+
description = "Update translation files through Transifex"
42+
43+
user_options = []
44+
45+
def initialize_options(self):
46+
pass
47+
48+
def finalize_options(self):
49+
pass
50+
51+
def run(self):
52+
subprocess.run(['tx', 'push', '--source'])
53+
subprocess.run(['tx', 'pull'])
54+
55+
1256
setup(
1357
name='sphinx_rtd_theme',
1458
version=__version__,
@@ -18,6 +62,10 @@
1862
author_email='[email protected]',
1963
description='Read the Docs theme for Sphinx',
2064
long_description=open('README.rst', encoding='utf-8').read(),
65+
cmdclass={
66+
'i18n': LocalizeCommand,
67+
'transifex': TransifexCommand,
68+
},
2169
zip_safe=False,
2270
packages=['sphinx_rtd_theme'],
2371
package_data={'sphinx_rtd_theme': [
@@ -44,6 +92,7 @@
4492
],
4593
'docs': [
4694
'sphinxcontrib-httpdomain',
95+
'sphinx_rtd_theme==0.4.3',
4796
]
4897
},
4998
classifiers=[

sphinx_rtd_theme/footer.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
{%- endif %}
2727

2828
{%- if build_id and build_url %}
29-
<span class="build">
29+
<span class="build">z
30+
{# Translators: Build is a noun, not a verb #}
3031
{% trans %}Build{% endtrans %}
3132
<a href="{{ build_url }}">{{ build_id }}</a>.
3233
</span>
0 Bytes
Binary file not shown.

sphinx_rtd_theme/locale/en/LC_MESSAGES/sphinx.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: sphinx_rtd_theme 0.4.3.dev0\n"
1010
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11-
"POT-Creation-Date: 2019-07-19 12:53-0600\n"
11+
"POT-Creation-Date: 2019-07-24 17:44-0600\n"
1212
"PO-Revision-Date: 2019-07-16 15:43-0600\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language: en\n"
0 Bytes
Binary file not shown.

sphinx_rtd_theme/locale/es/LC_MESSAGES/sphinx.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgid ""
66
msgstr ""
77
"Project-Id-Version: sphinx_rtd_theme 0.4.3.dev0\n"
88
"Report-Msgid-Bugs-To: [email protected]\n"
9-
"POT-Creation-Date: 2019-07-19 12:53-0600\n"
9+
"POT-Creation-Date: 2019-07-24 17:44-0600\n"
1010
"PO-Revision-Date: 2019-07-16 21:44+0000\n"
1111
"Last-Translator: Anthony <[email protected]>, 2019\n"
1212
"Language: es\n"
1.68 KB
Binary file not shown.
Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
# Dutch translations for sphinx_rtd_theme.
1+
# English translations for sphinx_rtd_theme.
22
# Copyright (C) 2019 ORGANIZATION
33
# This file is distributed under the same license as the sphinx_rtd_theme
44
# project.
55
# FIRST AUTHOR <EMAIL@ADDRESS>, 2019.
66
#
7+
# Translators:
8+
# Jesse Tan, 2019
79
msgid ""
810
msgstr ""
911
"Project-Id-Version: sphinx_rtd_theme 0.4.3.dev0\n"
10-
"Report-Msgid-Bugs-To: [email protected]\n"
11-
"POT-Creation-Date: 2019-07-19 12:53-0600\n"
12-
"PO-Revision-Date: 2019-07-19 12:50-0600\n"
13-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12+
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
13+
"POT-Creation-Date: 2019-07-24 17:44-0600\n"
14+
"PO-Revision-Date: 2019-07-16 21:44+0000\n"
15+
"Last-Translator: Jesse Tan, 2019\n"
1416
"Language: nl\n"
15-
"Language-Team: nl <[email protected]>\n"
17+
"Language-Team: Dutch "
18+
"(https://www.transifex.com/readthedocs/teams/101354/nl/)\n"
1619
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
1720
"MIME-Version: 1.0\n"
1821
"Content-Type: text/plain; charset=utf-8\n"
@@ -21,125 +24,127 @@ msgstr ""
2124

2225
#: sphinx_rtd_theme/breadcrumbs.html:31
2326
msgid "Docs"
24-
msgstr ""
27+
msgstr "Documentatie"
2528

2629
#: sphinx_rtd_theme/breadcrumbs.html:43 sphinx_rtd_theme/breadcrumbs.html:45
2730
msgid "Edit on GitHub"
28-
msgstr ""
31+
msgstr "Bewerk op GitHub"
2932

3033
#: sphinx_rtd_theme/breadcrumbs.html:50 sphinx_rtd_theme/breadcrumbs.html:52
3134
msgid "Edit on Bitbucket"
32-
msgstr ""
35+
msgstr "Bewerk op BitBucket"
3336

3437
#: sphinx_rtd_theme/breadcrumbs.html:57 sphinx_rtd_theme/breadcrumbs.html:59
3538
msgid "Edit on GitLab"
36-
msgstr ""
39+
msgstr "Bewerk op GitLab"
3740

3841
#: sphinx_rtd_theme/breadcrumbs.html:62 sphinx_rtd_theme/breadcrumbs.html:64
3942
msgid "View page source"
40-
msgstr ""
43+
msgstr "Bekijk paginabron"
4144

4245
#: sphinx_rtd_theme/breadcrumbs.html:74 sphinx_rtd_theme/footer.html:5
4346
msgid "Next"
44-
msgstr ""
47+
msgstr "Volgende"
4548

4649
#: sphinx_rtd_theme/breadcrumbs.html:77 sphinx_rtd_theme/footer.html:8
4750
msgid "Previous"
48-
msgstr ""
51+
msgstr "Vorige"
4952

5053
#: sphinx_rtd_theme/footer.html:21 sphinx_rtd_theme/footer.html:24
5154
#: sphinx_rtd_theme/layout.html:92
5255
msgid "Copyright"
53-
msgstr ""
56+
msgstr "Copyright"
5457

5558
#: sphinx_rtd_theme/footer.html:30
5659
msgid "Build"
57-
msgstr ""
60+
msgstr "Bouwsel"
5861

5962
#: sphinx_rtd_theme/footer.html:35
6063
msgid "Revision"
61-
msgstr ""
64+
msgstr "Revisie"
6265

6366
#: sphinx_rtd_theme/footer.html:39
6467
#, python-format
6568
msgid "Last updated on %(last_updated)s."
66-
msgstr ""
69+
msgstr "Laatste update op %(last_updated)s."
6770

6871
#: sphinx_rtd_theme/footer.html:49
6972
#, python-format
7073
msgid "Built with %(sphinx_web)s using a"
71-
msgstr ""
74+
msgstr "Gebouwd met %(sphinx_web)s met een"
7275

7376
#: sphinx_rtd_theme/footer.html:49
7477
msgid "theme"
75-
msgstr ""
78+
msgstr "thema"
7679

7780
#: sphinx_rtd_theme/footer.html:49
7881
#, python-format
7982
msgid "provided by %(readthedocs_web)s"
80-
msgstr ""
83+
msgstr "geleverd door %(readthedocs_web)s"
8184

8285
#: sphinx_rtd_theme/layout.html:61
8386
#, python-format
8487
msgid "Search within %(docstitle)s"
85-
msgstr ""
88+
msgstr "Zoek binnen %(docstitle)s"
8689

8790
#: sphinx_rtd_theme/layout.html:83
8891
msgid "About these documents"
89-
msgstr ""
92+
msgstr "Over deze documenten"
9093

9194
#: sphinx_rtd_theme/layout.html:86
9295
msgid "Index"
93-
msgstr ""
96+
msgstr "Index"
9497

9598
#: sphinx_rtd_theme/layout.html:89 sphinx_rtd_theme/search.html:11
9699
msgid "Search"
97-
msgstr ""
100+
msgstr "Zoek"
98101

99102
#: sphinx_rtd_theme/layout.html:124
100103
msgid "Logo"
101-
msgstr ""
104+
msgstr "Logo"
102105

103106
#: sphinx_rtd_theme/search.html:26
104107
msgid "Please activate JavaScript to enable the search functionality."
105-
msgstr ""
108+
msgstr "Zet JavaScript aan om de zoekfunctie mogelijk te maken."
106109

107110
#: sphinx_rtd_theme/search.html:33
108111
msgid "Search Results"
109-
msgstr ""
112+
msgstr "Zoekresultaten"
110113

111114
#: sphinx_rtd_theme/search.html:35
112115
msgid ""
113116
"Your search did not match any documents. Please make sure that all words "
114117
"are spelled correctly and that you've selected enough categories."
115118
msgstr ""
119+
"Zoekpoging vond geen documenten. Zorg ervoor dat alle woorden correct "
120+
"zijn gespeld en dat voldoende categorieën zijn geselecteerd."
116121

117122
#: sphinx_rtd_theme/searchbox.html:4
118123
msgid "Search docs"
119-
msgstr ""
124+
msgstr "Zoek in documentatie"
120125

121126
#: sphinx_rtd_theme/versions.html:11
122127
msgid "Versions"
123-
msgstr ""
128+
msgstr "Versies"
124129

125130
#: sphinx_rtd_theme/versions.html:17
126131
msgid "Downloads"
127-
msgstr ""
132+
msgstr "Downloads"
128133

129134
#. The phrase "Read the Docs" is not translated
130135
#: sphinx_rtd_theme/versions.html:24
131136
msgid "On Read the Docs"
132-
msgstr ""
137+
msgstr "Op Read the Docs"
133138

134139
#: sphinx_rtd_theme/versions.html:26
135140
msgid "Project Home"
136-
msgstr ""
141+
msgstr "Project Home"
137142

138143
#: sphinx_rtd_theme/versions.html:29
139144
msgid "Builds"
140-
msgstr ""
145+
msgstr "Bouwsels"
141146

142147
#: sphinx_rtd_theme/versions.html:33
143148
msgid "Free document hosting provided by"
144-
msgstr ""
149+
msgstr "Gratis hosting voor documentatie verzorgd door"
145150

0 commit comments

Comments
 (0)