diff options
-rw-r--r-- | debian/changelog | 4 | ||||
-rwxr-xr-x | scripts/po-check-preseed | 32 |
2 files changed, 35 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog index 61d89d7f2..c3a8dbd1a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,8 +5,10 @@ installation-guide (2008xxxx) UNRELEASED; urgency=low * Correct error spotted by Osamu Aoki: text web browser is w3m, not w3c. * Correct two minor errors in preconfiguration examples. With thanks to Andreas Beckmann for reporting them. Closes: #507544. + * Add new script po-check-preseed to help translators check if their + translation of a preseed.po file is complete. - -- Frans Pop <fjp@debian.org> Tue, 02 Dec 2008 13:13:53 +0100 + -- Frans Pop <fjp@debian.org> Tue, 02 Dec 2008 14:11:51 +0100 installation-guide (20081113) unstable; urgency=medium diff --git a/scripts/po-check-preseed b/scripts/po-check-preseed new file mode 100755 index 000000000..eb9fc9c59 --- /dev/null +++ b/scripts/po-check-preseed @@ -0,0 +1,32 @@ +#! /bin/sh + +if [ -z "$1" ] || [ ! -d po/"$1" ]; then + echo "Usage: $(basename $0) <language>" + exit 1 +fi + +cd po/$1 + +echo "This script performs a very basic sanity check to see if nothing has" +echo "been missed in the translation of preseed.po. It does this by counting" +echo "the number of lines that start with 'd-i' or '#d-i' for both msgid and" +echo "msgstr and printing the result. It will then print a diff between the" +echo "original and translation for a visual check." +echo +echo + +tmp_msgid=$(tempfile -p preseed_msgid.) +tmp_msgstr=$(tempfile -p preseed_msgstr.) + +sed -n "/^msgid/,/^msgstr/ p" preseed.po | grep -v msgstr | \ + grep "^\"#\?d-i " >$tmp_msgid +sed -n "/^msgstr/,/^$/ p" preseed.po | \ + grep "^\"#\?d-i " >$tmp_msgstr + +echo "Number of original lines: $(wc -l <$tmp_msgid)" +echo "Number of translated lines: $(wc -l <$tmp_msgstr)" +echo + +diff -U0 $tmp_msgid $tmp_msgstr + +rm -f $tmp_msgid $tmp_msgstr |