Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-3
1 #! /bin/sh
2
3 # When a header entry is provided by xgettext, it overrides any msgid ""
4 # present in the input.
5
6 tmpfiles=""
7 trap 'rm -fr $tmpfiles' 1 2 3 15
8
9 tmpfiles="$tmpfiles xg-test3.in.c"
10 cat <<EOF > xg-test3.in.c
11 This is a test of the xgettext functionality.
12 /* xgettext:no-c-format */
13 _("extract me")
14 Sometimes keywords can be spread apart
15 xgettext:no-c-format
16 _ ( "what about me" )
17 And even further on accasion
18 _
19 (
20 "hello"
21 )
22
23 /* no additional empty strings */
24 _("")
25 EOF
26
27 tmpfiles="$tmpfiles xg-test3.po"
28 : ${XGETTEXT=xgettext}
29 # delete POT-Creation-Date: line because the date depends on local time.
30 ${XGETTEXT} --output - --no-location -k_ xg-test3.in.c 2>/dev/null \
31   | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-test3.po
32
33 tmpfiles="$tmpfiles xg-test3.ok"
34 cat <<EOF > xg-test3.ok
35 # SOME DESCRIPTIVE TITLE.
36 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
37 # This file is distributed under the same license as the PACKAGE package.
38 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
39 #
40 #, fuzzy
41 msgid ""
42 msgstr ""
43 "Project-Id-Version: PACKAGE VERSION\n"
44 "Report-Msgid-Bugs-To: \n"
45 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
46 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
47 "Language-Team: LANGUAGE <LL@li.org>\n"
48 "Language: \n"
49 "MIME-Version: 1.0\n"
50 "Content-Type: text/plain; charset=CHARSET\n"
51 "Content-Transfer-Encoding: 8bit\n"
52
53 #, no-c-format
54 msgid "extract me"
55 msgstr ""
56
57 msgid "what about me"
58 msgstr ""
59
60 msgid "hello"
61 msgstr ""
62 EOF
63
64 : ${DIFF=diff}
65 ${DIFF} xg-test3.ok xg-test3.po
66 result=$?
67
68 rm -fr $tmpfiles
69
70 exit $result