I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
  • str4d's avatar
    17c265bd
    Strip out commented-out translations after update · 17c265bd
    str4d authored
    This is necessary because:
    - Transifex runs 'msgfmt -c' on any uploaded .po file
    - pybabel adds a spurious '#~ msgid ""' to the end of some files
    - 'msgfmt -c' ignores that this is commented out, and treats it
      as a syntax error (clashing with the top file definition)
    17c265bd
    History
    Strip out commented-out translations after update
    str4d authored
    This is necessary because:
    - Transifex runs 'msgfmt -c' on any uploaded .po file
    - pybabel adds a spurious '#~ msgid ""' to the end of some files
    - 'msgfmt -c' ignores that this is commented out, and treats it
      as a syntax error (clashing with the top file definition)
update-existing-po.sh 489 B
#!/bin/sh
. ./etc/translation.vars
export TZ=UTC

if [ $# -ge 1 ]
then
    $PYBABEL update -D $1 -i $POTDIR/$1.pot -d $TRANSDIR
    for file in $(ls i2p2www/translations/*/LC_MESSAGES/$1.po); do
        sed -i '/^#~/,+2d' $file
    done
else
    for domain in $(ls $BABELCFG); do
        $PYBABEL update -D $domain -i $POTDIR/$domain.pot -d $TRANSDIR
        for file in $(ls i2p2www/translations/*/LC_MESSAGES/$domain.po); do
            sed -i '/^#~/,+2d' $file
        done
    done
fi