aboutsummaryrefslogtreecommitdiff
path: root/docs/build.sh
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2020-08-26 21:13:53 -0700
committerMicah Lee <micah@micahflee.com>2020-08-26 21:13:53 -0700
commit5e8a64cb7cd5fc0afc558df540d30b9368b3f26d (patch)
treef91e35601b4c084eddb01c1e733484afaf9871ed /docs/build.sh
parent84fc623e994c55e3c9359cb3b956298ab446fae0 (diff)
downloadonionshare-5e8a64cb7cd5fc0afc558df540d30b9368b3f26d.tar.gz
onionshare-5e8a64cb7cd5fc0afc558df540d30b9368b3f26d.zip
Add the same locales that OnionShare is translated into
Diffstat (limited to 'docs/build.sh')
-rwxr-xr-xdocs/build.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/build.sh b/docs/build.sh
new file mode 100755
index 00000000..0893aa83
--- /dev/null
+++ b/docs/build.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# Supported locales
+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"
+
+# Generate English .po files
+make 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/localized_html > /dev/null
+mkdir -p build/localized_html
+
+make html
+mv build/html build/localized_html/en
+
+for LOCALE in $LOCALES; do
+ make -e SPHINXOPTS="-D language='$LOCALE'" html
+ mv build/html build/localized_html/$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/localized_html/index.html \ No newline at end of file