1#! /bin/sh
2
3# Test non-ASCII msgids when the PO file and the POT file are in different
4# encodings.
5
6tmpfiles=""
7trap 'rm -fr $tmpfiles' 1 2 3 15
8
9tmpfiles="$tmpfiles mm-test16.po"
10cat <<\EOF > mm-test16.po
11msgid ""
12msgstr ""
13"Project-Id-Version: hello-cplusplus-qt 0\n"
14"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n"
15"POT-Creation-Date: 2003-10-20 10:14+0200\n"
16"PO-Revision-Date: 2003-10-20 10:13+0200\n"
17"Last-Translator: Bruno Haible <bruno@clisp.org>\n"
18"Language-Team: Polish <pl@li.org>\n"
19"MIME-Version: 1.0\n"
20"Content-Type: text/plain; charset=ISO-8859-2\n"
21"Content-Transfer-Encoding: 8bit\n"
22"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
23"|| n%100>=20) ? 1 : 2);\n"
24
25#: hello.cc:45
26msgid "Written by Fran�ois Pinard."
27msgstr "Program napisa� Fran�ois Pinard."
28
29#: hello.cc:52
30msgid "error %1."
31msgstr "b��d %1."
32EOF
33
34tmpfiles="$tmpfiles mm-test16.pot"
35cat <<EOF > mm-test16.pot
36# SOME DESCRIPTIVE TITLE.
37# Copyright (C) YEAR Yoyodyne, Inc.
38# This file is distributed under the same license as the PACKAGE package.
39# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
40#
41#, fuzzy
42msgid ""
43msgstr ""
44"Project-Id-Version: PACKAGE VERSION\n"
45"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n"
46"POT-Creation-Date: 2003-10-20 10:14+0200\n"
47"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
48"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
49"Language-Team: LANGUAGE <LL@li.org>\n"
50"MIME-Version: 1.0\n"
51"Content-Type: text/plain; charset=UTF-8\n"
52"Content-Transfer-Encoding: 8bit\n"
53
54#: hello.cc:45
55msgid "Written by Fran??ois Pinard."
56msgstr ""
57
58#: hello.cc:52
59msgid "error %1."
60msgstr ""
61EOF
62
63tmpfiles="$tmpfiles mm-test16.new.po"
64: ${MSGMERGE=msgmerge}
65${MSGMERGE} -q -o mm-test16.new.po mm-test16.po mm-test16.pot
66test $? = 0 || { rm -fr $tmpfiles; exit 1; }
67
68tmpfiles="$tmpfiles mm-test16.ok"
69cat <<\EOF > mm-test16.ok
70msgid ""
71msgstr ""
72"Project-Id-Version: hello-cplusplus-qt 0\n"
73"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n"
74"POT-Creation-Date: 2003-10-20 10:14+0200\n"
75"PO-Revision-Date: 2003-10-20 10:13+0200\n"
76"Last-Translator: Bruno Haible <bruno@clisp.org>\n"
77"Language-Team: Polish <pl@li.org>\n"
78"MIME-Version: 1.0\n"
79"Content-Type: text/plain; charset=UTF-8\n"
80"Content-Transfer-Encoding: 8bit\n"
81"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
82"|| n%100>=20) ? 1 : 2);\n"
83
84#: hello.cc:45
85msgid "Written by Fran��ois Pinard."
86msgstr "Program napisa�� Fran��ois Pinard."
87
88#: hello.cc:52
89msgid "error %1."
90msgstr "b����d %1."
91EOF
92
93: ${DIFF=diff}
94${DIFF} mm-test16.ok mm-test16.new.po
95result=$?
96
97rm -fr $tmpfiles
98
99exit $result
100