Skip to content

Commit e1a34ca

Browse files
authored
Improvements to translation related settings (#397)
* add verbose flag to sphinx for easier debugging * update translation settings
1 parent a11876d commit e1a34ca

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

DISCOVER/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
comments_config = {'hypothesis': False, 'utterances': False}
3737
copyright = '2023'
3838
exclude_patterns = ['**.ipynb_checkpoints', '.DS_Store', 'Thumbs.db', '_build']
39+
# configure translations
40+
locale_dirs = ["../locales"]
41+
# recommendations from https://docs.readthedocs.com/platform/stable/guides/manage-translations-sphinx.html#create-translatable-files
42+
gettext_uuid = True
43+
gettext_compact = False
44+
3945
extensions = [
4046
'sphinx_togglebutton',
4147
'sphinx_copybutton',

Translation.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ sphinx-build -b gettext DISCOVER/ DISCOVER/_build/gettext
1111
```
1212
This will store extracted strings in .pot files inside DISCOVER/_build/gettext.
1313

14+
> [!NOTE]
15+
> We have set [`gettext_uuid`](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-gettext_uuid) to `True` which can be slow.
16+
> The cookbook isn't very large so it will generally not be relevant, but the linked sphinx docs have tips on accelerating that if relevant.
17+
1418
## Updating .po Files
1519
To update existing translations, use the following command:
1620

ci/build_website.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ rm -rf DISCOVER/_tags/*
1515

1616
# Build the documentation
1717
echo "Building $LANGUAGE version..."
18-
WEBSITE_VERSION="$VERSION" WEBSITE_LANGUAGE="$LANGUAGE" sphinx-build -b html DISCOVER/ DISCOVER/_build/html
18+
WEBSITE_VERSION="$VERSION" WEBSITE_LANGUAGE="$LANGUAGE" sphinx-build -b html DISCOVER/ DISCOVER/_build/html -v

0 commit comments

Comments
 (0)