anki/qt/po/scripts/update-po-template
Damien Elmes dfda5750a1 add new strings to .po files as part of template update
Pontoon appears to only update existing gettext translations; it
won't add new ones on its own. Fixes
https://forums.ankiweb.net/t/anki-2-1-28-beta/629/6
2020-07-02 10:03:39 +10:00

28 lines
587 B
Bash
Executable File

#!/bin/bash
#
# update template .pot file from source code strings,
# and merge new strings into translations
#
set -eu -o pipefail ${SHELLFLAGS}
topDir=$(dirname $0)/../../../
cd $topDir
all=all.files
echo "Updating anki.pot..."
for i in pylib/anki/{*.py,importing/*.py}; do
echo $i >> $all
done
for i in qt/aqt/{*.py,forms/*.py}; do
echo $i >> $all
done
xgettext -cT: -s --no-wrap --files-from=$all --output=qt/po/repo/desktop/anki.pot
rm $all
cd qt/po/repo/desktop
for dir in $(ls | grep -v anki.pot); do
msgmerge --no-wrap -U --backup off $dir/anki.po anki.pot
done