Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgmerge-17
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test that untranslated messages that are brought over from the .pot file
5 # get the right number of msgstrs.
6
7 cat <<\EOF > mm-test17.po
8 # Irish translations.
9 msgid ""
10 msgstr ""
11 "Content-Type: text/plain; charset=UTF-8\n"
12 "Content-Transfer-Encoding: 8bit\n"
13 "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;\n"
14
15 #, c-format
16 msgid "'Your command, please?', asked the waiter."
17 msgstr ""
18 EOF
19
20 cat <<\EOF > mm-test17.pot
21 # SOME DESCRIPTIVE TITLE.
22 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
23 # This file is distributed under the same license as the PACKAGE package.
24 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
25 #
26 #, fuzzy
27 msgid ""
28 msgstr ""
29 "Project-Id-Version: PACKAGE VERSION\n"
30 "Report-Msgid-Bugs-To: \n"
31 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
32 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
33 "Language-Team: LANGUAGE <LL@li.org>\n"
34 "MIME-Version: 1.0\n"
35 "Content-Type: text/plain; charset=CHARSET\n"
36 "Content-Transfer-Encoding: 8bit\n"
37
38 #, c-format
39 msgid "'Your command, please?', asked the waiter."
40 msgstr ""
41
42 #, c-format
43 msgid "a piece of cake"
44 msgid_plural "%d pieces of cake"
45 msgstr[0] ""
46 msgstr[1] ""
47
48 #, c-format
49 msgid "%s is replaced by %s."
50 msgstr ""
51 EOF
52
53 : ${MSGMERGE=msgmerge}
54 ${MSGMERGE} -q -o mm-test17.tmp.po mm-test17.po mm-test17.pot || exit 1
55 LC_ALL=C tr -d '\r' < mm-test17.tmp.po > mm-test17.new.po || exit 1
56
57 cat <<\EOF > mm-test17.ok
58 # Irish translations.
59 msgid ""
60 msgstr ""
61 "Report-Msgid-Bugs-To: \n"
62 "Content-Type: text/plain; charset=UTF-8\n"
63 "Content-Transfer-Encoding: 8bit\n"
64 "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;\n"
65
66 #, c-format
67 msgid "'Your command, please?', asked the waiter."
68 msgstr ""
69
70 #, c-format
71 msgid "a piece of cake"
72 msgid_plural "%d pieces of cake"
73 msgstr[0] ""
74 msgstr[1] ""
75 msgstr[2] ""
76
77 #, c-format
78 msgid "%s is replaced by %s."
79 msgstr ""
80 EOF
81
82 : ${DIFF=diff}
83 ${DIFF} mm-test17.ok mm-test17.new.po
84 result=$?
85
86 exit $result