Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-ycp-2
1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test YCP support: --add-comments option.
5
6 cat <<EOF > xg-y-2.ycp
7 // This comment will not be extracted.
8 print (_("help"));
9 //  TRANSLATORS: This is an extracted comment.
10 print (_("me"));
11 # TRANSLATORS: This is extracted too.
12 print (_("and you"));
13 /* Not extracted either. */
14 print (_("Hey Jude"));
15 /*  TRANSLATORS:
16      Nickname of the Beatles
17 */
18 print (_("The Fabulous Four"));
19 EOF
20
21 : ${XGETTEXT=xgettext}
22 ${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
23   -d xg-y-2.tmp xg-y-2.ycp || exit 1
24 LC_ALL=C tr -d '\r' < xg-y-2.tmp.po > xg-y-2.po || exit 1
25
26 cat <<EOF > xg-y-2.ok
27 msgid "help"
28 msgstr ""
29
30 #. TRANSLATORS: This is an extracted comment.
31 msgid "me"
32 msgstr ""
33
34 #. TRANSLATORS: This is extracted too.
35 msgid "and you"
36 msgstr ""
37
38 msgid "Hey Jude"
39 msgstr ""
40
41 #. TRANSLATORS:
42 #. Nickname of the Beatles
43 #.
44 msgid "The Fabulous Four"
45 msgstr ""
46 EOF
47
48 : ${DIFF=diff}
49 ${DIFF} xg-y-2.ok xg-y-2.po
50 result=$?
51
52 exit $result