explicitly import _ in forms/

This commit is contained in:
Damien Elmes 2019-03-04 11:34:30 +10:00
parent 3721cc4604
commit d802a53161
2 changed files with 5 additions and 4 deletions

View File

@ -27,10 +27,11 @@ do
echo "from . import $base" >> $temp
if [ $i -nt $py ]; then
echo " * "$py
pyuic5 --from-imports $i -o $py
pyuic5 --from-imports $i -o $py.tmp
# munge the output to use gettext
perl -pi.bak -e 's/(QtGui\.QApplication\.)?_?translate\(".*?", /_(/; s/, None.*/))/' $py
rm $py.bak
cat $py.tmp | sed "/WARNING/ a\\
from anki.lang import _" | perl -p -e 's/(QtGui\.QApplication\.)?_?translate\(".*?", /_(/; s/, None.*/))/' > $py
rm $py.tmp
fi
done
echo "]" >> $init

View File

@ -1,4 +1,4 @@
#!/bin/bash
TOOLS="$(cd "`dirname "$0"`"; pwd)"
pylint -E -j 0 -f colorized --disable=E0602 $TOOLS/../anki $TOOLS/../aqt
pylint -E -j 0 -f colorized $TOOLS/../anki $TOOLS/../aqt