• 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 Shell support: --add-comments option.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-sh-2.sh"
9cat <<EOF > xg-sh-2.sh
10# This comment will not be extracted.
11gettext "help"
12#  TRANSLATORS: This is an extracted comment.
13gettext "me"
14# Not extracted either.
15gettext "Hey Jude"
16# TRANSLATORS:
17#    Nickname of the Beatles
18gettext "The Fabulous Four"
19EOF
20
21tmpfiles="$tmpfiles xg-sh-2.tmp.po xg-sh-2.po"
22: ${XGETTEXT=xgettext}
23${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
24  -d xg-sh-2.tmp xg-sh-2.sh
25test $? = 0 || { rm -fr $tmpfiles; exit 1; }
26tr -d '\r' < xg-sh-2.tmp.po > xg-sh-2.po
27test $? = 0 || { rm -fr $tmpfiles; exit 1; }
28
29tmpfiles="$tmpfiles xg-sh-2.ok"
30cat <<EOF > xg-sh-2.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-sh-2.ok xg-sh-2.po
49result=$?
50
51rm -fr $tmpfiles
52
53exit $result
54