• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test C support: extraction of contexts specified in GNOME glib syntax.
5
6cat <<\EOF > xg-c-ctxt-3.c
7/* (glib) The 1-argument Q_ macro is a gettext with context. */
8print (Q_ ("Printer|Open"));
9/* (hypothetical) The 2-argument Q_ macro is an ngettext with contexts. */
10print (Q_ ("Menu|Recent File", "Menu|Recent Files"));
11EOF
12
13: ${XGETTEXT=xgettext}
14${XGETTEXT} --omit-header --no-location \
15  --keyword=Q_:1g --keyword=Q_:1g,2g \
16  -d xg-c-ctxt-3.tmp xg-c-ctxt-3.c || Exit 1
17LC_ALL=C tr -d '\r' < xg-c-ctxt-3.tmp.po > xg-c-ctxt-3.po || Exit 1
18
19cat <<EOF > xg-c-ctxt-3.ok
20msgctxt "Printer"
21msgid "Open"
22msgstr ""
23
24msgctxt "Menu"
25msgid "Recent File"
26msgid_plural "Recent Files"
27msgstr[0] ""
28msgstr[1] ""
29EOF
30
31: ${DIFF=diff}
32${DIFF} xg-c-ctxt-3.ok xg-c-ctxt-3.po
33result=$?
34
35exit $result
36