weblate/scripts/update-locales
Michal Čihař 7ccb4e5a92 Use commit
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-11 11:21:23 +02:00

38 lines
948 B
Bash
Executable file

#!/bin/sh
# Renerates .po files used for translating Weblate
# Exit on failure
set -e
# Lock Weblate
wlc lock weblate/master
wlc lock weblate/javascript
# Push changes from Weblate to GitHub
wlc commit
# Pull changes from GitHub
git pull
# Update po files itself
./manage.py makemessages --keep-pot -a -i 'data/*' -i 'docs/*' -i 'examples/*' -i 'build/*' --settings=weblate.settings_test
./manage.py makemessages --keep-pot -a -i 'data/*' -i 'docs/*' -i 'examples/*' -i 'build/*' -d djangojs --settings=weblate.settings_test
# Fix Report-Msgid-Bugs-To as it gets removed
sed -i 's/"Report-Msgid-Bugs-To:.*/"Report-Msgid-Bugs-To: weblate@lists.cihar.com\\n"/' weblate/locale/*/*/*.po
# Commit changes
git add weblate/locale/*/*/*.po
git add weblate/locale/django.pot weblate/locale/djangojs.pot
git commit -s -m "Update po files
[CI skip]"
# Push changes
git push
# Unlock Weblate
wlc unlock weblate/master
wlc unlock weblate/javascript