File: build.sh

package info (click to toggle)
onionshare 2.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 21,628 kB
  • sloc: python: 14,487; javascript: 10,725; sh: 137; makefile: 56; xml: 29
file content (34 lines) | stat: -rwxr-xr-x 1,029 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash

VERSION=$(cat ../cli/onionshare_cli/resources/version.txt)

# Supported locales
LOCALES="en sq bg zh_Hans de el ga ja pl ru es tr uk"

# 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