3 # Test C support: extraction of contexts specified in GNOME glib syntax.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles xg-c-15.c"
10 /* (glib) The 1-argument Q_ macro is a gettext with context. */
11 print (Q_ ("Printer|Open"));
12 /* (hypothetical) The 2-argument Q_ macro is an ngettext with contexts. */
13 print (Q_ ("Menu|Recent File", "Menu|Recent Files"));
16 tmpfiles="$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
21 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
22 LC_ALL=C tr -d '\r' < xg-c-15.tmp.po > xg-c-15.po
23 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
25 tmpfiles="$tmpfiles xg-c-15.ok"
26 cat <<EOF > xg-c-15.ok
33 msgid_plural "Recent Files"
39 ${DIFF} xg-c-15.ok xg-c-15.po