Skip to content

Commit cd1788b

Browse files
OriolAbrilcetagostinijuanitorduzpre-commit-ci[bot]
authored
Setting infraestructure for Translations (ES site) (#1906)
* set up translation infra demo * add sample notebook for translation * Add Spanish translations to MMM example notebook This commit provides Spanish translations for the MMM example notebook's .po file, covering all notebook sections, explanations, and code comments. The update improves accessibility for Spanish-speaking users and ensures consistency with the original English content. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Additional translation * update contributing guide with current translation workflow --------- Co-authored-by: Carlos Trujillo <[email protected]> Co-authored-by: Juan Orduz <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent b34d559 commit cd1788b

File tree

5 files changed

+1867
-0
lines changed

5 files changed

+1867
-0
lines changed

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,45 @@ We recommend that your contribution complies with the following guidelines befor
152152
make format
153153
```
154154
155+
## Translations
156+
157+
### For translators
158+
To kick off translations for the website we are going to start without any cloud-based
159+
collaborative translation service. This means translating will be similar to
160+
code contributions, people will open a PR adding the translations to the `.po` files
161+
inside `/locales/es/LC_MESSAGES`. PO files can be edited as raw text or with an
162+
editor designed for translating like [Poedit](https://poedit.net/).
163+
164+
165+
### For language coordinators/release managers
166+
To keep the workflow simple, we will only update the translatable sources every now and then.
167+
One option is to do that with every release, another option is doing it every now and then
168+
on a different cadence.
169+
170+
The steps to follow to update the translatable sources are:
171+
172+
1. Generate the updated translatable messages with Sphinx. This is similar to building
173+
the website (also take more or less as long) but it generates a different kind of
174+
output: `.pot` files which are a template for the language specific `.po` files
175+
we'll generate later.
176+
177+
```bash
178+
sphinx-build docs/source docs/gettext -b gettext
179+
```
180+
1. Update the Spanish `.po` files
181+
182+
```bash
183+
sphinx-intl update -p docs/gettext -l es
184+
```
185+
186+
### Translated build preview
187+
188+
To build the docs in a different language:
189+
190+
```bash
191+
sphinx-build docs/source docs/build -b html -D language=es
192+
```
193+
155194
## Overview of the MMM codebase
156195

157196
Packages

docs/source/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@
7373
# The name of the Pygments (syntax highlighting) style to use.
7474
pygments_style = "friendly"
7575

76+
# sphinx settings related to generation of translatable sources
77+
gettext_uuid = True
78+
gettext_compact = False
79+
7680
# -- Extension configuration ------------------------------------------------
7781

7882
# configure notfound extension to not add any prefix to the urls

environment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ dependencies:
2929
# Extra dependencies for lint, testing and docs build
3030
# docs
3131
- sphinx
32+
- sphinx-intl
3233
- ipython!=8.7.0
3334
- myst-parser
3435
- myst-nb
36+
- numpydoc
3537
- pydata-sphinx-theme>=0.12.0.dev0
3638
- sphinx-copybutton
3739
- sphinx-autodoc-typehints

0 commit comments

Comments
 (0)