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