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