Skip to content
Snippets Groups Projects
Commit dc938565 authored by Julian's avatar Julian
Browse files

Added update_translations.sh and CI job that outputs coverage

parent 884e6070
No related branches found
No related tags found
No related merge requests found
...@@ -65,3 +65,8 @@ html5validator: ...@@ -65,3 +65,8 @@ html5validator:
paths: paths:
- pages - pages
- html5validator.log - html5validator.log
trans_de:
stage: test
script:
- ./update_translations.sh de
#!/bin/sh
set -e
pybabel extract -F uffd/babel.cfg -k lazy_gettext -o messages.pot uffd
pybabel update -i messages.pot -d uffd/translations
pybabel compile -d uffd/translations
if [ -n "$1" ]; then
NUM_EMPTY="$(tr '\n' '|' < uffd/translations/$1/LC_MESSAGES/messages.po | sed 's/msgstr ""|/empty/g' | tr '|' '\n' | grep '^empty$' | wc -l)"
NUM_TOTAL="$(grep '^msgid' uffd/translations/$1/LC_MESSAGES/messages.po | wc -l)"
# Emulate python-coverage output
echo "TOTAL $NUM_TOTAL $(( $NUM_TOTAL - $NUM_EMPTY )) $(( 100 * ($NUM_TOTAL - $NUM_EMPTY) / $NUM_TOTAL ))%"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment