2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test checking of KDE format strings.
6 cat <<\EOF > f-kd-2.data
7 # Valid: %% doesn't count
10 # Valid: digit sequence starting with 0 doesn't count
13 # Valid: digit sequence starting with 0 doesn't count
16 # Valid: digit sequence starting with 0 doesn't count
19 # Valid: L is not a recognized flag
22 # Valid: same arguments
25 # Invalid: different arguments
28 # Invalid: different arguments
31 # Valid: repetition of an argument in the translation
34 # Valid: removing repeated argument in the translation
40 # Invalid: too few arguments
41 msgid "abc%2def%1ghi%3"
43 # Invalid: only one argument removed (valid only in singular form)
44 msgid "abc%2def%1ghi%3"
46 # Invalid: only one argument removed (valid only in singular form)
47 msgid "abc%2def%1ghi%3"
49 # Invalid: only one argument removed (valid only in singular form)
50 msgid "abc%2def%1ghi%3"
52 # Invalid: only one argument removed (valid only in singular form)
55 # Invalid: wrong argument removed
58 # Invalid: too many arguments
61 # Invalid: missing non-final argument (valid only in singular form)
64 # Invalid: added non-final argument
71 while read comment; do
75 cat <<EOF > f-kd-2-$n.po
81 if echo "$comment" | grep 'Valid:' > /dev/null; then
82 if ${MSGFMT} --check-format -o f-kd-2-$n.mo f-kd-2-$n.po; then
88 ${MSGFMT} --check-format -o f-kd-2-$n.mo f-kd-2-$n.po 2> /dev/null
95 if test -n "$fail"; then
96 echo "Format string checking error:" 1>&2
100 rm -f f-kd-2-$n.po f-kd-2-$n.mo