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