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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
#! /bin/sh
# Test format string checking in plural entries.
tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15
tmpfiles="$tmpfiles mf-test10.po1"
cat <<\EOF > mf-test10.po1
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: GNU bison\n"
"PO-Revision-Date: 2001-04-05 19:47+0200\n"
"Last-Translator: ABC DEF <abc@gnu.uucp>\n"
"Language-Team: test <test@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-9\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/reduce.c:511
#, c-format
msgid "%d useless nonterminal"
msgid_plural "%d useless nonterminals"
msgstr[0] "1 yararsz deiken simge"
msgstr[1] "%d yararsz deiken simges"
#: src/reduce.c:520
#, c-format
msgid "one useless rule"
msgid_plural "%d useless rules"
msgstr[0] "%d yararsz kural"
msgstr[1] "%d yararsz kurals"
EOF
: ${MSGFMT=msgfmt}
${MSGFMT} --check -o /dev/null mf-test10.po1
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
tmpfiles="$tmpfiles mf-test10.po2"
cat <<\EOF > mf-test10.po2
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: GNU bison\n"
"PO-Revision-Date: 2001-04-05 19:47+0200\n"
"Last-Translator: ABC DEF <abc@gnu.uucp>\n"
"Language-Team: test <test@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-9\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/reduce.c:520
#, c-format
msgid "one useless rule"
msgid_plural "%d useless rules"
msgstr[0] "%d yararsz kural"
msgstr[1] "%d yararsz kural%s"
EOF
tmpfiles="$tmpfiles mf-test10.err"
: ${MSGFMT=msgfmt}
LC_MESSAGES=C LC_ALL= \
${MSGFMT} --check -o /dev/null mf-test10.po2 \
2>&1 | grep -v '^==' | sed -e 's|[^ ]*\\msgfmt\.exe|msgfmt|' -e 's|^msgfmt\.exe|msgfmt|' | LC_ALL=C tr -d '\r' > mf-test10.err
tmpfiles="$tmpfiles mf-test10.ok"
cat << EOF > mf-test10.ok
mf-test10.po2:20: number of format specifications in 'msgid_plural' and 'msgstr[1]' does not match
msgfmt: found 1 fatal error
EOF
: ${DIFF=diff}
${DIFF} mf-test10.ok mf-test10.err
result=$?
rm -fr $tmpfiles
exit $result
|