File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,14 @@ touch logs/sphinxlint.txt
20
20
21
21
cd cpython/Doc
22
22
23
- # Disable literal blocks and update PO
24
- sed -i " /^\s*'literal-block',/s/ '/ #'/" conf.py
25
- # TODO: use `make -C .. gettext` when there are only Python >= 3.12
26
- opts=' -E -b gettext -q -D gettext_compact=0 -d build/.doctrees . build/gettext'
27
- make build ALLSPHINXOPTS=" $opts "
28
- # Update translation files with latest POT
29
- sphinx-intl update -p build/gettext -l ${PYDOC_LANGUAGE} > /dev/null
23
+ # If version is 3.12 or newer, then disable literal-block, generate POT and
24
+ # update translations with fresh POT files.
25
+ minor_version=$( git branch --show-current | sed ' s|^3\.||' )
26
+ if [ $minor_version -ge 12 ]; then
27
+ sed -i " /^\s*'literal-block',/s/ '/ #'/" conf.py
28
+ make gettext
29
+ sphinx-intl update -p build/gettext -l ${PYDOC_LANGUAGE} > /dev/null
30
+ fi
30
31
31
32
cd locales/${PYDOC_LANGUAGE} /LC_MESSAGES
32
33
set +e
You can’t perform that action at this time.
0 commit comments