summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/msgfmt-10
blob: 8b38f19d41181106b1429bda8ba24cfbb2a4bed2 (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
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
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test format string checking in plural entries.

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"
"Language: test\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 yararsız değişken simge"
msgstr[1] "%d yararsız değişken simges"

#: src/reduce.c:520
#, c-format
msgid "one useless rule"
msgid_plural "%d useless rules"
msgstr[0] "%d yararsız kural"
msgstr[1] "%d yararsız kurals"
EOF

: ${MSGFMT=msgfmt}
${MSGFMT} --check -o /dev/null mf-test10.po1 || Exit 1

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"
"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 yararsız kural"
msgstr[1] "%d yararsız kural%s"
EOF

: ${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

cat << EOF > mf-test10.ok
mf-test10.po2:6: warning: header field 'Language-Team' missing in header
mf-test10.po2:6: warning: header field 'Language' missing in header
mf-test10.po2:19: 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=$?

exit $result