xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/tests/xgettext-5 (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1#! /bin/sh
2
3# Test extraction of non-ASCII msgids.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-test5.c"
9cat <<EOF > xg-test5.c
10void foo (int option)
11{
12  printf (_("%s: nezn�m� p�ep�na� -- %c\n"), option);
13  printf (_("%s: p�ep�na� vy�aduje argument -- %c\n"), option);
14}
15EOF
16
17tmpfiles="$tmpfiles xg-test5.po"
18: ${XGETTEXT=xgettext}
19${XGETTEXT} --no-location -k_ -o xg-test5.po xg-test5.c 2>/dev/null
20test $? = 1 || { rm -fr $tmpfiles; exit 1; }
21${XGETTEXT} --no-location -k_ --from-code=iso-8859-2 -o xg-test5.po xg-test5.c
22test $? = 0 || { rm -fr $tmpfiles; exit 1; }
23
24tmpfiles="$tmpfiles xg-test5.pot"
25sed -e '/POT-Creation-Date/d' < xg-test5.po > xg-test5.pot
26
27tmpfiles="$tmpfiles xg-test5.ok"
28cat <<EOF > xg-test5.ok
29# SOME DESCRIPTIVE TITLE.
30# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
31# This file is distributed under the same license as the PACKAGE package.
32# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
33#
34#, fuzzy
35msgid ""
36msgstr ""
37"Project-Id-Version: PACKAGE VERSION\n"
38"Report-Msgid-Bugs-To: \n"
39"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
40"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
41"Language-Team: LANGUAGE <LL@li.org>\n"
42"MIME-Version: 1.0\n"
43"Content-Type: text/plain; charset=UTF-8\n"
44"Content-Transfer-Encoding: 8bit\n"
45
46#, c-format
47msgid "%s: neznámý přepínač -- %c\n"
48msgstr ""
49
50#, c-format
51msgid "%s: přepínač vyžaduje argument -- %c\n"
52msgstr ""
53EOF
54
55: ${DIFF=diff}
56${DIFF} xg-test5.ok xg-test5.pot
57result=$?
58
59rm -fr $tmpfiles
60
61exit $result
62