blob: eb9fc9c59223f6dc2fb5c870b9e5ad4f5dfee8cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
|