tcheck-cformat.sh - vaccinewars - be a doctor and try to vaccinate the world
 (HTM) git clone git://src.adamsgaard.dk/vaccinewars
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       tcheck-cformat.sh (584B)
       ---
            1 #!/bin/bash
            2 
            3 # Check all translations for broken printf format strings
            4 
            5 # Usually this is done by msgfmt, but it chokes on our %Tde and %P notations,
            6 # so we disable it in the Makefile.
            7 
            8 # This simple script temporarily replaces each %Tde with %s and each %P
            9 # with %d, so that msgfmt can be run.
           10 
           11 POFILES=$(grep '^POFILES =' Makefile|cut -d= -f2)
           12 
           13 for po in ${POFILES}; do
           14   perl -p -e 's/%(([0-9]+$)?-?[0-9]*)[tT]../((t)%\1s/g; s/%(([0-9]+$)?-?[0-9]*)P/(P)%\1d/g' < ${po} > ${po}.tmp; msgfmt -c --statistics --verbose ${po}.tmp > /dev/null && rm -f ${po}.tmp
           15 done
           16 rm -f messages.mo