tools/check-po.sh: full rewrite of the script