Skip to content
Snippets Groups Projects
Select Git revision
  • 05df7091b631dacd3d7590c3fb72bbd561ae93c5
  • master default protected
  • pw-autocomplete-off
  • redis-rate-limits
  • typehints
  • incremental-sync
  • test_instance_path
  • consistent_strings
  • qol_edits
  • v1.2.x
  • v1.x.x
  • v1.1.x
  • feature_invite_validuntil_minmax
  • Dockerfile
  • pylint_disable_consider-using-f-string
  • v1.0.x
  • roles-recursive-cte
  • v2.2.0
  • v2.1.0
  • v2.0.1
  • v2.0.0
  • v1.2.0
  • v1.1.2
  • v1.1.1
  • v1.0.2
  • v1.1.0
  • v1.0.1
  • v1.0.0
  • v0.3.0
  • v0.2.0
  • v0.1.5
  • v0.1.4
  • v0.1.2
33 results

update_translations.sh

Blame
  • Forked from uffd / uffd
    Source project has a limited visibility.
    update_translations.sh 572 B
    #!/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