• 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: extraction of contexts specified in GNOME glib syntax.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-c-15.c"
9cat <<\EOF > xg-c-15.c
10/* (glib) The 1-argument Q_ macro is a gettext with context. */
11print (Q_ ("Printer|Open"));
12/* (hypothetical) The 2-argument Q_ macro is an ngettext with contexts. */
13print (Q_ ("Menu|Recent File", "Menu|Recent Files"));
14EOF
15
16tmpfiles="$tmpfiles xg-c-15.tmp.po xg-c-15.po"
17: ${XGETTEXT=xgettext}
18${XGETTEXT} --omit-header --no-location \
19  --keyword=Q_:1g --keyword=Q_:1g,2g \
20  -d xg-c-15.tmp xg-c-15.c
21test $? = 0 || { rm -fr $tmpfiles; exit 1; }
22tr -d '\r' < xg-c-15.tmp.po > xg-c-15.po
23test $? = 0 || { rm -fr $tmpfiles; exit 1; }
24
25tmpfiles="$tmpfiles xg-c-15.ok"
26cat <<EOF > xg-c-15.ok
27msgctxt "Printer"
28msgid "Open"
29msgstr ""
30
31msgctxt "Menu"
32msgid "Recent File"
33msgid_plural "Recent Files"
34msgstr[0] ""
35msgstr[1] ""
36EOF
37
38: ${DIFF=diff}
39${DIFF} xg-c-15.ok xg-c-15.po
40result=$?
41
42rm -fr $tmpfiles
43
44exit $result
45