• 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 PHP support: --add-comments option.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-ph-1.php"
9cat <<EOF > xg-ph-1.php
10<?
11// This comment will not be extracted.
12echo _("help");
13//  TRANSLATORS: This is an extracted comment.
14echo _("me");
15# TRANSLATORS: This is extracted too.
16echo _("and you");
17/* Not extracted either. */
18echo _("Hey Jude");
19/*  TRANSLATORS:
20     Nickname of the Beatles
21*/
22echo _("The Fabulous Four");
23// This will not be extracted.
24echo _(table["key"]);
25?>
26EOF
27
28tmpfiles="$tmpfiles xg-ph-1.tmp.po xg-ph-1.po"
29: ${XGETTEXT=xgettext}
30${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
31  -d xg-ph-1.tmp xg-ph-1.php
32test $? = 0 || { rm -fr $tmpfiles; exit 1; }
33tr -d '\r' < xg-ph-1.tmp.po > xg-ph-1.po
34test $? = 0 || { rm -fr $tmpfiles; exit 1; }
35
36tmpfiles="$tmpfiles xg-ph-1.ok"
37cat <<EOF > xg-ph-1.ok
38msgid "help"
39msgstr ""
40
41#. TRANSLATORS: This is an extracted comment.
42msgid "me"
43msgstr ""
44
45#. TRANSLATORS: This is extracted too.
46msgid "and you"
47msgstr ""
48
49msgid "Hey Jude"
50msgstr ""
51
52#. TRANSLATORS:
53#. Nickname of the Beatles
54#.
55msgid "The Fabulous Four"
56msgstr ""
57EOF
58
59: ${DIFF=diff}
60${DIFF} xg-ph-1.ok xg-ph-1.po
61result=$?
62
63rm -fr $tmpfiles
64
65exit $result
66