RASCSI/python/web/translation_update.sh

25 lines
571 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -e
cd "$(dirname "$0")"
2023-02-04 06:24:21 +00:00
# Create the venv if it doesn't exist
if ! test -e venv; then
2023-02-04 06:24:21 +00:00
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 \;