RASCSI/python/web/translation_update.sh
2023-02-03 22:24:21 -08:00

25 lines
571 B
Bash
Executable File

#!/usr/bin/env bash
set -e
cd "$(dirname "$0")"
# Create the venv if it doesn't exist
if ! test -e venv; then
echo "Creating python venv for PiSCSI-Web"
python3 -m venv venv
echo "Activating venv"
source venv/bin/activate
echo "Installing requirements.txt"
pip3 install wheel
pip3 install -r requirements.txt
fi
source venv/bin/activate
pybabel extract -F babel.cfg -o messages.pot src
pybabel update -i messages.pot -d src/translations
echo
echo "Translation stats:"
find . -name \*.po -print -execdir msgfmt --statistics messages.po \;