2020-08-27 00:13:53 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-11-15 17:44:58 -05:00
|
|
|
VERSION=`cat ../cli/onionshare_cli/resources/version.txt`
|
2020-09-03 14:52:02 -04:00
|
|
|
|
2020-08-27 00:13:53 -04:00
|
|
|
# Supported locales
|
2021-09-26 14:41:01 -04:00
|
|
|
LOCALES="en fi pl pt_BR ru tr uk"
|
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
|
2020-09-17 12:43:22 -04:00
|
|
|
echo '<html><head><meta http-equiv="refresh" content="0; url='$VERSION'/en/" /><script>document.location="'$VERSION'/en/"</script></head></html>' > build/docs/index.html
|