Only build Sphinx po for current langs with live instance

Building for each lang takes several minutes, so saves a lot of build time.
More langs will be added as they are more complete and a Read The Docs instance
is created for them.
This commit is contained in:
Rémi Verschelde
2018-05-18 14:29:49 +02:00
parent d3523f702b
commit 43fb59cce6
2 changed files with 9 additions and 2 deletions

6
build_langs.txt Normal file
View File

@@ -0,0 +1,6 @@
de
es
fr
pt_BR
uk
zh_CN

View File

@@ -8,6 +8,7 @@ SPHINX_TEMPLATES_DIR="sphinx/templates"
# This one is manually maintained, see --templates-list switch
SPHINX_TEMPLATES=$(sed -e 's@^@'$SPHINX_TEMPLATES_DIR'/@' templates_list.txt)
SPHINX_PO_DIR="sphinx/po"
SPHINX_BUILD_LANGS=$(cat build_langs.txt)
WEBLATE_DIR="weblate"
WEBLATE_TEMPLATE="$WEBLATE_DIR/docs.pot"
@@ -129,9 +130,9 @@ if [ "$update_sphinx_po" = true ]; then
# First clean previous folder to take into account potentially removed files
rm -rf $SPHINX_PO_DIR
mkdir $SPHINX_PO_DIR
for po in $WEBLATE_POFILES; do
for lang in $SPHINX_BUILD_LANGS; do
po=$WEBLATE_DIR"/"$lang".po"
echo "Merging $po..."
lang=$(basename "$po" .po)
langdir="$SPHINX_PO_DIR/$lang/LC_MESSAGES"
mkdir -p "$langdir"
for template in $SPHINX_TEMPLATES; do