2020-08-27 00:13:53 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-08-22 16:22:34 -04: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
|
2022-01-17 13:33:13 -05:00
|
|
|
LOCALES="en fr de el it nb_NO pl pt_BR ru es 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
|