3 # Test C support: extraction of contexts, disambiguating according to the
7 trap 'rm -fr $tmpfiles' 1 2 3 15
9 tmpfiles="$tmpfiles xg-c-11.c"
10 cat <<\EOF > xg-c-11.c
11 // (KDE) The 1-argument i18n macro is a simple gettext without context.
12 print (i18n ("help"));
13 // (KDE) The 2-argument i18n macro has the context first.
14 print (i18n ("Help", "about"));
15 // (KDE) The 3-argument i18n macro is an ngettext without context.
16 print (i18n ("error", "errors", 7));
19 tmpfiles="$tmpfiles xg-c-11.tmp.po xg-c-11.po"
20 : ${XGETTEXT=xgettext}
21 ${XGETTEXT} --omit-header --no-location \
22 --keyword=i18n:1 --keyword=i18n:1c,2,2t --keyword=i18n:1,2,3t \
23 -d xg-c-11.tmp xg-c-11.c
24 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
25 LC_ALL=C tr -d '\r' < xg-c-11.tmp.po > xg-c-11.po
26 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
28 tmpfiles="$tmpfiles xg-c-11.ok"
29 cat <<EOF > xg-c-11.ok
44 ${DIFF} xg-c-11.ok xg-c-11.po