• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test C support: --add-comments option.
5
6cat <<EOF > xg-c-comment-5.c
7// This comment will not be extracted.
8print (gettext ("help"));
9//  TRANSLATORS: This is an extracted comment.
10print (gettext ("me"));
11/* Not extracted either. */
12print (gettext ("Hey Jude"));
13/*  TRANSLATORS:
14     Nickname of the Beatles
15*/
16print (gettext ("The Fabulous Four"));
17/* TRANSLATORS: The strings get concatenated.  */
18print (gettext ("there is not enough"
19" room on a single line for this entire long, " // confusing, eh?
20"verbose string"));
21EOF
22
23: ${XGETTEXT=xgettext}
24${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
25  -d xg-c-comment-5.tmp xg-c-comment-5.c || Exit 1
26LC_ALL=C tr -d '\r' < xg-c-comment-5.tmp.po > xg-c-comment-5.po || Exit 1
27
28cat <<EOF > xg-c-comment-5.ok
29msgid "help"
30msgstr ""
31
32#. TRANSLATORS: This is an extracted comment.
33msgid "me"
34msgstr ""
35
36msgid "Hey Jude"
37msgstr ""
38
39#. TRANSLATORS:
40#. Nickname of the Beatles
41#.
42msgid "The Fabulous Four"
43msgstr ""
44
45#. TRANSLATORS: The strings get concatenated.
46msgid ""
47"there is not enough room on a single line for this entire long, verbose "
48"string"
49msgstr ""
50EOF
51
52: ${DIFF=diff}
53${DIFF} xg-c-comment-5.ok xg-c-comment-5.po
54result=$?
55
56exit $result
57