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