Skip to content

Commit 8701aaa

Browse files
authored
Set up es and pt translations (#154)
* Set up es and pt translations * add switcher * fix rtd build * fix icons
1 parent 97e7fa6 commit 8701aaa

File tree

81 files changed

+13993
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+13993
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ instance/
7171
# Sphinx documentation
7272
_build/
7373
jupyter_execute/
74+
gettext
7475

7576
# PyBuilder
7677
target/

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22

33
sphinx:
44
configuration: conf.py
5-
fail_on_warning: true
5+
fail_on_warning: false
66

77

88
python:

.tx/config

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
[main]
2+
host = https://www.transifex.com
3+
4+
[o:pymc:p:data-umbrella-sprints-website:r:index]
5+
file_filter = locales/<lang>/LC_MESSAGES/index.po
6+
source_file = gettext/index.pot
7+
type = PO
8+
minimum_perc = 0
9+
resource_name = index
10+
11+
[o:pymc:p:data-umbrella-sprints-website:r:sprint_events]
12+
file_filter = locales/<lang>/LC_MESSAGES/sprint_events.po
13+
source_file = gettext/sprint_events.pot
14+
type = PO
15+
minimum_perc = 0
16+
resource_name = sprint_events
17+
18+
[o:pymc:p:data-umbrella-sprints-website:r:sphinx]
19+
file_filter = locales/<lang>/LC_MESSAGES/sphinx.po
20+
source_file = gettext/sphinx.pot
21+
type = PO
22+
minimum_perc = 0
23+
resource_name = sphinx
24+
25+
[o:pymc:p:data-umbrella-sprints-website:r:404]
26+
file_filter = locales/<lang>/LC_MESSAGES/404.po
27+
source_file = gettext/404.pot
28+
type = PO
29+
minimum_perc = 0
30+
resource_name = 404
31+
32+
[o:pymc:p:data-umbrella-sprints-website:r:CODE_OF_CONDUCT]
33+
file_filter = locales/<lang>/LC_MESSAGES/CODE_OF_CONDUCT.po
34+
source_file = gettext/CODE_OF_CONDUCT.pot
35+
type = PO
36+
minimum_perc = 0
37+
resource_name = CODE_OF_CONDUCT
38+
39+
[o:pymc:p:data-umbrella-sprints-website:r:contributing_index]
40+
file_filter = locales/<lang>/LC_MESSAGES/contributing/index.po
41+
source_file = gettext/contributing/index.pot
42+
type = PO
43+
minimum_perc = 0
44+
resource_name = contributing/index
45+
46+
[o:pymc:p:data-umbrella-sprints-website:r:contributing_donate]
47+
file_filter = locales/<lang>/LC_MESSAGES/contributing/donate.po
48+
source_file = gettext/contributing/donate.pot
49+
type = PO
50+
minimum_perc = 0
51+
resource_name = contributing/donate
52+
53+
[o:pymc:p:data-umbrella-sprints-website:r:sprint_sprint-guide]
54+
file_filter = locales/<lang>/LC_MESSAGES/sprint/sprint-guide.po
55+
source_file = gettext/sprint/sprint-guide.pot
56+
type = PO
57+
minimum_perc = 0
58+
resource_name = sprint/sprint-guide
59+
60+
[o:pymc:p:data-umbrella-sprints-website:r:sprint_index]
61+
file_filter = locales/<lang>/LC_MESSAGES/sprint/index.po
62+
source_file = gettext/sprint/index.pot
63+
type = PO
64+
minimum_perc = 0
65+
resource_name = sprint/index
66+
67+
[o:pymc:p:data-umbrella-sprints-website:r:sprint_faq]
68+
file_filter = locales/<lang>/LC_MESSAGES/sprint/faq.po
69+
source_file = gettext/sprint/faq.pot
70+
type = PO
71+
minimum_perc = 0
72+
resource_name = sprint/faq
73+
74+
[o:pymc:p:data-umbrella-sprints-website:r:sprint_resources]
75+
file_filter = locales/<lang>/LC_MESSAGES/sprint/resources.po
76+
source_file = gettext/sprint/resources.pot
77+
type = PO
78+
minimum_perc = 0
79+
resource_name = sprint/resources
80+
81+
[o:pymc:p:data-umbrella-sprints-website:r:sprint_prep-work]
82+
file_filter = locales/<lang>/LC_MESSAGES/sprint/prep-work.po
83+
source_file = gettext/sprint/prep-work.pot
84+
type = PO
85+
minimum_perc = 0
86+
resource_name = sprint/prep-work
87+
88+
[o:pymc:p:data-umbrella-sprints-website:r:sprint_sprint-cheatsheet]
89+
file_filter = locales/<lang>/LC_MESSAGES/sprint/sprint-cheatsheet.po
90+
source_file = gettext/sprint/sprint-cheatsheet.pot
91+
type = PO
92+
minimum_perc = 0
93+
resource_name = sprint/sprint-cheatsheet
94+
95+
[o:pymc:p:data-umbrella-sprints-website:r:sprint_tutorials_sample_docstring]
96+
file_filter = locales/<lang>/LC_MESSAGES/sprint/tutorials/sample_docstring.po
97+
source_file = gettext/sprint/tutorials/sample_docstring.pot
98+
type = PO
99+
minimum_perc = 0
100+
resource_name = sprint/tutorials/sample_docstring
101+
102+
[o:pymc:p:data-umbrella-sprints-website:r:sprint_tutorials_environment_setup]
103+
file_filter = locales/<lang>/LC_MESSAGES/sprint/tutorials/environment_setup.po
104+
source_file = gettext/sprint/tutorials/environment_setup.pot
105+
type = PO
106+
minimum_perc = 0
107+
resource_name = sprint/tutorials/environment_setup
108+
109+
[o:pymc:p:data-umbrella-sprints-website:r:sprint_tutorials_pr_tutorial]
110+
file_filter = locales/<lang>/LC_MESSAGES/sprint/tutorials/pr_tutorial.po
111+
source_file = gettext/sprint/tutorials/pr_tutorial.pot
112+
type = PO
113+
minimum_perc = 0
114+
resource_name = sprint/tutorials/pr_tutorial
115+
116+
[o:pymc:p:data-umbrella-sprints-website:r:sprint_tutorials_docstring_tutorial]
117+
file_filter = locales/<lang>/LC_MESSAGES/sprint/tutorials/docstring_tutorial.po
118+
source_file = gettext/sprint/tutorials/docstring_tutorial.pot
119+
type = PO
120+
minimum_perc = 0
121+
resource_name = sprint/tutorials/docstring_tutorial
122+
123+
[o:pymc:p:data-umbrella-sprints-website:r:2022-07_sprint_schedule]
124+
file_filter = locales/<lang>/LC_MESSAGES/2022-07_sprint/schedule.po
125+
source_file = gettext/2022-07_sprint/schedule.pot
126+
type = PO
127+
minimum_perc = 0
128+
resource_name = 2022-07_sprint/schedule
129+
130+
[o:pymc:p:data-umbrella-sprints-website:r:2022-07_sprint_index]
131+
file_filter = locales/<lang>/LC_MESSAGES/2022-07_sprint/index.po
132+
source_file = gettext/2022-07_sprint/index.pot
133+
type = PO
134+
minimum_perc = 0
135+
resource_name = 2022-07_sprint/index
136+
137+
[o:pymc:p:data-umbrella-sprints-website:r:2022-07_sprint_sprint_parties_community_partners]
138+
file_filter = locales/<lang>/LC_MESSAGES/2022-07_sprint/sprint_parties/community_partners.po
139+
source_file = gettext/2022-07_sprint/sprint_parties/community_partners.pot
140+
type = PO
141+
minimum_perc = 0
142+
resource_name = 2022-07_sprint/sprint_parties/community_partners
143+
144+
[o:pymc:p:data-umbrella-sprints-website:r:2022-07_sprint_sprint_parties_sponsors]
145+
file_filter = locales/<lang>/LC_MESSAGES/2022-07_sprint/sprint_parties/sponsors.po
146+
source_file = gettext/2022-07_sprint/sprint_parties/sponsors.pot
147+
type = PO
148+
minimum_perc = 0
149+
resource_name = 2022-07_sprint/sprint_parties/sponsors
150+
151+
[o:pymc:p:data-umbrella-sprints-website:r:2022-07_sprint_sprint_parties_contributors]
152+
file_filter = locales/<lang>/LC_MESSAGES/2022-07_sprint/sprint_parties/contributors.po
153+
source_file = gettext/2022-07_sprint/sprint_parties/contributors.pot
154+
type = PO
155+
minimum_perc = 0
156+
resource_name = 2022-07_sprint/sprint_parties/contributors
157+
158+
[o:pymc:p:data-umbrella-sprints-website:r:2022-07_sprint_sprint_parties_organizers]
159+
file_filter = locales/<lang>/LC_MESSAGES/2022-07_sprint/sprint_parties/organizers.po
160+
source_file = gettext/2022-07_sprint/sprint_parties/organizers.pot
161+
type = PO
162+
minimum_perc = 0
163+
resource_name = 2022-07_sprint/sprint_parties/organizers
164+
165+
[o:pymc:p:data-umbrella-sprints-website:r:2022-07_sprint_sprint_parties_index]
166+
file_filter = locales/<lang>/LC_MESSAGES/2022-07_sprint/sprint_parties/index.po
167+
source_file = gettext/2022-07_sprint/sprint_parties/index.pot
168+
type = PO
169+
minimum_perc = 0
170+
resource_name = 2022-07_sprint/sprint_parties/index
171+
172+
[o:pymc:p:data-umbrella-sprints-website:r:2022-07_sprint_sprint_parties_media_kit]
173+
file_filter = locales/<lang>/LC_MESSAGES/2022-07_sprint/sprint_parties/media_kit.po
174+
source_file = gettext/2022-07_sprint/sprint_parties/media_kit.pot
175+
type = PO
176+
minimum_perc = 0
177+
resource_name = 2022-07_sprint/sprint_parties/media_kit
178+
179+
[o:pymc:p:data-umbrella-sprints-website:r:2022-02_sprint_index]
180+
file_filter = locales/<lang>/LC_MESSAGES/2022-02_sprint/index.po
181+
source_file = gettext/2022-02_sprint/index.pot
182+
type = PO
183+
minimum_perc = 0
184+
resource_name = 2022-02_sprint/index
185+
186+
[o:pymc:p:data-umbrella-sprints-website:r:2022-02_sprint_organizers_index]
187+
file_filter = locales/<lang>/LC_MESSAGES/2022-02_sprint/organizers/index.po
188+
source_file = gettext/2022-02_sprint/organizers/index.pot
189+
type = PO
190+
minimum_perc = 0
191+
resource_name = 2022-02_sprint/organizers/index
192+
193+
[o:pymc:p:data-umbrella-sprints-website:r:about_index]
194+
file_filter = locales/<lang>/LC_MESSAGES/about/index.po
195+
source_file = gettext/about/index.pot
196+
type = PO
197+
minimum_perc = 0
198+
resource_name = about/index
199+
200+
[o:pymc:p:data-umbrella-sprints-website:r:about_contributing_to_pymc_index]
201+
file_filter = locales/<lang>/LC_MESSAGES/about/contributing_to_pymc/index.po
202+
source_file = gettext/about/contributing_to_pymc/index.pot
203+
type = PO
204+
minimum_perc = 0
205+
resource_name = about/contributing_to_pymc/index
206+
207+
[o:pymc:p:data-umbrella-sprints-website:r:about_intro_to_array_operations_notebook]
208+
file_filter = locales/<lang>/LC_MESSAGES/about/intro_to_array_operations/notebook.po
209+
source_file = gettext/about/intro_to_array_operations/notebook.pot
210+
type = PO
211+
minimum_perc = 0
212+
resource_name = about/intro_to_array_operations/notebook
213+
214+
[o:pymc:p:data-umbrella-sprints-website:r:about_intro_to_array_operations_index]
215+
file_filter = locales/<lang>/LC_MESSAGES/about/intro_to_array_operations/index.po
216+
source_file = gettext/about/intro_to_array_operations/index.pot
217+
type = PO
218+
minimum_perc = 0
219+
resource_name = about/intro_to_array_operations/index
220+
221+
[o:pymc:p:data-umbrella-sprints-website:r:about_intuitive_modeling_index]
222+
file_filter = locales/<lang>/LC_MESSAGES/about/intuitive_modeling/index.po
223+
source_file = gettext/about/intuitive_modeling/index.pot
224+
type = PO
225+
minimum_perc = 0
226+
resource_name = about/intuitive_modeling/index
227+
228+
[o:pymc:p:data-umbrella-sprints-website:r:about_contributing_to_documentation_docs_presentation]
229+
file_filter = locales/<lang>/LC_MESSAGES/about/contributing_to_documentation/docs_presentation.po
230+
source_file = gettext/about/contributing_to_documentation/docs_presentation.pot
231+
type = PO
232+
minimum_perc = 0
233+
resource_name = about/contributing_to_documentation/docs_presentation
234+
235+
[o:pymc:p:data-umbrella-sprints-website:r:about_contributing_to_documentation_index]
236+
file_filter = locales/<lang>/LC_MESSAGES/about/contributing_to_documentation/index.po
237+
source_file = gettext/about/contributing_to_documentation/index.pot
238+
type = PO
239+
minimum_perc = 0
240+
resource_name = about/contributing_to_documentation/index
241+
242+
[o:pymc:p:data-umbrella-sprints-website:r:about_example_pr_index]
243+
file_filter = locales/<lang>/LC_MESSAGES/about/example_pr/index.po
244+
source_file = gettext/about/example_pr/index.pot
245+
type = PO
246+
minimum_perc = 0
247+
resource_name = about/example_pr/index
248+
249+
[o:pymc:p:data-umbrella-sprints-website:r:about_probabilistic_programming_with_pymc_notebook]
250+
file_filter = locales/<lang>/LC_MESSAGES/about/probabilistic_programming_with_pymc/notebook.po
251+
source_file = gettext/about/probabilistic_programming_with_pymc/notebook.pot
252+
type = PO
253+
minimum_perc = 0
254+
resource_name = about/probabilistic_programming_with_pymc/notebook
255+
256+
[o:pymc:p:data-umbrella-sprints-website:r:about_probabilistic_programming_with_pymc_index]
257+
file_filter = locales/<lang>/LC_MESSAGES/about/probabilistic_programming_with_pymc/index.po
258+
source_file = gettext/about/probabilistic_programming_with_pymc/index.pot
259+
type = PO
260+
minimum_perc = 0
261+
resource_name = about/probabilistic_programming_with_pymc/index

_static/switcher.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{
3+
"version": "en",
4+
"url": "https://pymc-data-umbrella.xyz/en/latest/"
5+
},
6+
{
7+
"version": "es",
8+
"url": "https://pymc-data-umbrella.xyz/es/latest/"
9+
},
10+
{
11+
"version": "pt",
12+
"url": "https://pymc-data-umbrella.xyz/pt/latest/"
13+
}
14+
]

conf.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from pathlib import Path
2+
import os
23

34
# Sphinx configuration build
45
# -- General configuration ------------------------------------------------
@@ -15,8 +16,14 @@
1516
"sphinxext.rediraffe",
1617
]
1718

19+
# Translations config
20+
locale_dirs = ["locales"]
21+
gettext_uuid = True
22+
gettext_compact = False
23+
language = os.environ.get("READTHEDOCS_LANGUAGE", "en")
24+
1825
# configure notfound extension to not add any prefix to the urls
19-
notfound_urls_prefix = "/en/latest/"
26+
notfound_urls_prefix = f"/{language}/latest/"
2027

2128
# Add any paths that contain templates here, relative to this directory.
2229
templates_path = ["_templates"]
@@ -64,18 +71,11 @@
6471
# The full version, including alpha/beta/rc tags.
6572
release = version
6673

67-
# The language for content autogenerated by Sphinx. Refer to documentation
68-
# for a list of supported languages.
69-
#
70-
# This is also used if you do content translation via gettext catalogs.
71-
# Usually you set "language" from the command line for these cases.
72-
language = None
73-
7474
# List of patterns, relative to source directory, that match files and
7575
# directories to ignore when looking for source files.
7676
# This patterns also effect to html_static_path and html_extra_path
7777
exclude_patterns = [
78-
"build", "Thumbs.db", ".DS_Store", ".ipynb_checkpoints", "README.md", "CONTRIBUTING.md", "jupyter_execute", "**.part.md"
78+
"build", "Thumbs.db", ".DS_Store", ".ipynb_checkpoints", "README.md", "CONTRIBUTING.md", "jupyter_execute", "**.part.md", "write_tx_config.py"
7979
]
8080

8181
# The name of the Pygments (syntax highlighting) style to use.
@@ -109,21 +109,25 @@
109109
{
110110
"name": "GitHub",
111111
"url": "https://github.com/pymc-devs/pymc-data-umbrella",
112-
"icon": "fab fa-github-square",
112+
"icon": "fa-brands fa-github",
113113
},
114114
{
115115
"name": "Discourse",
116116
"url": "https://discourse.pymc.io",
117-
"icon": "fab fa-discourse",
117+
"icon": "fa-brands fa-discourse",
118118
}
119119
],
120120
"use_edit_page_button": True,
121-
"page_sidebar_items": ["page-toc", "edit-this-page", "cheatsheet"],
122-
"navbar_start": ["navbar-logo"],
121+
"secondary_sidebar_items": ["page-toc", "searchbox", "edit-this-page", "sourcelink", "cheatsheet"],
122+
"navbar_start": ["navbar-logo", "version-switcher"],
123123
"navbar_end": ["navbar-icon-links"],
124124
"search_bar_text": "Search...",
125125
"footer_items": ["coc_notice", "copyright", "sphinx-version"],
126126
"google_analytics_id": "G-8YL5S5CGYD",
127+
"switcher": {
128+
"json_url": "https://pymc-data-umbrella.xyz/en/latest/_static/switcher.json",
129+
"version_match": language
130+
},
127131
}
128132

129133
html_context = {

0 commit comments

Comments
 (0)