aboutsummaryrefslogtreecommitdiff
path: root/docs/build.sh
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2020-10-13 17:28:54 -0700
committerMicah Lee <micah@micahflee.com>2020-10-13 17:28:54 -0700
commitb42f92d714145dcc6282773e61f68c00b4b79a28 (patch)
treeee4443ab3c5300db279a3cf0686380074d98c973 /docs/build.sh
parentf4abcf1be9122a28005dc3e0949bf5952192e982 (diff)
downloadonionshare-b42f92d714145dcc6282773e61f68c00b4b79a28.tar.gz
onionshare-b42f92d714145dcc6282773e61f68c00b4b79a28.zip
Move docs back to root, move onionshare_gui into briefcase app, and make modifications so briefcase app will work
Diffstat (limited to 'docs/build.sh')
-rwxr-xr-xdocs/build.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/docs/build.sh b/docs/build.sh
new file mode 100755
index 00000000..f120fab7
--- /dev/null
+++ b/docs/build.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+VERSION=`cat ../share/version.txt`
+
+# Supported locales
+LOCALES="ar ca da de el en es fa fr ga it is ja nb_NO nl pl pt_BR pt_PT ro ru sr@latin sv te tr uk zh_CN zh_TW"
+
+# Generate English .po files
+make gettext
+rm -rf gettext > /dev/null
+cp -r build/gettext gettext
+
+# Update all .po files for all locales
+for LOCALE in $LOCALES; do
+ sphinx-intl update -p build/gettext -l $LOCALE
+done
+
+# Build all locales
+rm -rf build/html build/docs > /dev/null
+mkdir -p build/docs/$VERSION
+
+make html
+mv build/html build/docs/$VERSION/en
+
+for LOCALE in $LOCALES; do
+ make -e SPHINXOPTS="-D language='$LOCALE'" html
+ mv build/html build/docs/$VERSION/$LOCALE
+done
+
+# Redirect to English by default
+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