3 # a small script to check the completeness of po/POTFILES.in
5 # should be ran from top_srcdir
8 if [ ! -r ${PO} ]; then
9 echo "${PO}: file not found" 1>&2
10 echo "This script should be ran from top_srcdir." 1>&2
14 # first, check that all .ui are in po/POTFILE.in
20 echo "checking that all .ui are in ${PO}..."
21 for f
in $
(find src
-name '*.ui' |
sed 's?^\./??'); do
22 if [ "$(grep -x ${f} ${PO})" != "${f}" ]; then
23 echo " ${f} should be added to ${PO}"
28 echo "pass 1/5: count=${count} error(s)=${errs}"
31 # second, check that all .ui in PO exist
36 echo "checking that all .ui from ${PO} actually exist..."
37 for f
in $
(grep -E '\.ui$' ${PO}); do
38 if [ ! -r ${f} ]; then
39 echo " ${f} should be removed from ${PO}"
44 echo "pass 2/5: count=${count} error(s)=${errs}"
47 # third, check that all files which use _( construct are in PO
52 echo "checking that all translatable files are in ${PO}..."
53 exceptions_pass3
="src/test/check-po.sh"
54 for f
in $
(git
grep '_(' src | cut
-d: -f1 |
sort -u); do
55 if [ "$(echo ${exceptions_pass3} | grep -w ${f})" = "" ]; then
56 if [ "$(grep -x ${f} ${PO})" != "${f}" ]; then
57 echo " ${f} should be added to ${PO}"
63 echo "pass 3/5: count=${count} error(s)=${errs}"
66 # fourth, check that all files in PO actually use the _( construct
71 echo "checking that all files in ${PO} actually use the '_(' construct..."
72 for f
in $
(grep -E '^src/' ${PO} |
grep -vE '\.ui$' |
grep -vE '\.in$'); do
73 grep '_(' ${f} 1>/dev
/null
2>&1
75 echo " ${f} should be removed from ${PO}"
80 echo "pass 4/5: count=${count} error(s)=${errs}"
83 # last, check that all files which include gi18n.h are relevant
88 echo "checking that all files have a good reason to include gi18n.h..."
89 for f
in $
(git
grep '#include <glib/gi18n.h>' src | cut
-d: -f1 |
sort -u); do
90 grep '_(' ${f} 1>/dev
/null
2>&1
92 echo " ${f} should not include <glib/gi18n.h>"
97 echo "pass 5/5: count=${count} error(s)=${errs}"
101 echo "total: ${total} error(s)."