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