• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
7cat <<\EOF > mm-test17.po
8# Irish translations.
9msgid ""
10msgstr ""
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
16msgid "'Your command, please?', asked the waiter."
17msgstr ""
18EOF
19
20cat <<\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
27msgid ""
28msgstr ""
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
39msgid "'Your command, please?', asked the waiter."
40msgstr ""
41
42#, c-format
43msgid "a piece of cake"
44msgid_plural "%d pieces of cake"
45msgstr[0] ""
46msgstr[1] ""
47
48#, c-format
49msgid "%s is replaced by %s."
50msgstr ""
51EOF
52
53: ${MSGMERGE=msgmerge}
54${MSGMERGE} -q -o mm-test17.tmp.po mm-test17.po mm-test17.pot || Exit 1
55LC_ALL=C tr -d '\r' < mm-test17.tmp.po > mm-test17.new.po || Exit 1
56
57cat <<\EOF > mm-test17.ok
58# Irish translations.
59msgid ""
60msgstr ""
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
67msgid "'Your command, please?', asked the waiter."
68msgstr ""
69
70#, c-format
71msgid "a piece of cake"
72msgid_plural "%d pieces of cake"
73msgstr[0] ""
74msgstr[1] ""
75msgstr[2] ""
76
77#, c-format
78msgid "%s is replaced by %s."
79msgstr ""
80EOF
81
82: ${DIFF=diff}
83${DIFF} mm-test17.ok mm-test17.new.po
84result=$?
85
86exit $result
87