2020-08-27 00:13:53 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-09-03 14:52:02 -04:00
|
|
|
VERSION=`cat ../share/version.txt`
|
|
|
|
|
2020-08-27 00:13:53 -04:00
|
|
|
# Supported locales
|
2020-09-03 14:52:02 -04:00
|
|
|
#LOCALES="ar ca zh_CN zh_TW da nl en fr de el is ga it ja nb fa pl pt_BR pt_PT ro ru sr@latin es sv te tr uk"
|
|
|
|
LOCALES="ar ca da nl en"
|
2020-08-27 00:13:53 -04:00
|
|
|
|
|
|
|
# Generate English .po files
|
|
|
|
make gettext
|
2020-08-27 16:36:08 -04:00
|
|
|
rm -rf gettext > /dev/null
|
|
|
|
cp -r build/gettext gettext
|
2020-08-27 00:13:53 -04:00
|
|
|
|
|
|
|
# Update all .po files for all locales
|
|
|
|
for LOCALE in $LOCALES; do
|
|
|
|
sphinx-intl update -p build/gettext -l $LOCALE
|
|
|
|
done
|
|
|
|
|
|
|
|
# Build all locales
|
2020-09-03 14:52:02 -04:00
|
|
|
rm -rf build/html build/docs > /dev/null
|
|
|
|
mkdir -p build/docs/$VERSION
|
2020-08-27 00:13:53 -04:00
|
|
|
|
|
|
|
make html
|
2020-09-03 14:52:02 -04:00
|
|
|
mv build/html build/docs/$VERSION/en
|
2020-08-27 00:13:53 -04:00
|
|
|
|
|
|
|
for LOCALE in $LOCALES; do
|
|
|
|
make -e SPHINXOPTS="-D language='$LOCALE'" html
|
2020-09-03 14:52:02 -04:00
|
|
|
mv build/html build/docs/$VERSION/$LOCALE
|
2020-08-27 00:13:53 -04:00
|
|
|
done
|
|
|
|
|
|
|
|
# Redirect to English by default
|
2020-09-03 14:52:02 -04:00
|
|
|
echo '<html><head><meta http-equiv="refresh" content="0; url=en/" /><script>document.location="en/"</script></head></html>' > build/docs/$VERSION/index.html
|
|
|
|
|
|
|
|
# Redirect to latest version
|
|
|
|
echo '<html><head><meta http-equiv="refresh" content="0; url='$VERSION'/en/" /><script>document.location="'$VERSION'/en/"</script></head></html>' > build/docs/index.html
|