mirror of
https://github.com/onionshare/onionshare.git
synced 2025-12-16 00:34:09 -05:00
- converted tool.poetry to PEP 621 (default behavior for poetry) - converted setup.py to PEP 621 (recommended by setuptools) - use pyproject.toml instead of version.txt - use importlib instead of version.txt - use PEP 621 dependency format in flatpak build scripts - added tomli as a dev dependency (used in build scripts) - removed version.txt (no longer used) - cleaned up dependencies - version is still in desktop/setup.py (unclear on how snapcraft uses it) - poetry lockfiles need to be rebuilt
34 lines
1.1 KiB
Bash
Executable file
34 lines
1.1 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
VERSION=$(cat ../cli/pyproject.toml | python -c 'import tomllib,sys;print(tomllib.load(sys.stdin)["project"]["version"])')
|
|
|
|
# Supported locales
|
|
LOCALES="en sq bg zh_CN 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
|