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.tmp.po mm-test17.new.po"
58: ${MSGMERGE=msgmerge}
59${MSGMERGE} -q -o mm-test17.tmp.po mm-test17.po mm-test17.pot
60test $? = 0 || { rm -fr $tmpfiles; exit 1; }
61tr -d '\r' < mm-test17.tmp.po > mm-test17.new.po
62test $? = 0 || { rm -fr $tmpfiles; exit 1; }
63
64tmpfiles="$tmpfiles mm-test17.ok"
65cat <<\EOF > mm-test17.ok
66# Irish translations.
67msgid ""
68msgstr ""
69"Report-Msgid-Bugs-To: \n"
70"Content-Type: text/plain; charset=UTF-8\n"
71"Content-Transfer-Encoding: 8bit\n"
72"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;\n"
73
74#, c-format
75msgid "'Your command, please?', asked the waiter."
76msgstr ""
77
78#, c-format
79msgid "a piece of cake"
80msgid_plural "%d pieces of cake"
81msgstr[0] ""
82msgstr[1] ""
83msgstr[2] ""
84
85#, c-format
86msgid "%s is replaced by %s."
87msgstr ""
88EOF
89
90: ${DIFF=diff}
91${DIFF} mm-test17.ok mm-test17.new.po
92result=$?
93
94rm -fr $tmpfiles
95
96exit $result
97