1#! /bin/sh 2 3# Test C support: extraction of contexts, disambiguating according to the 4# argument count. 5 6tmpfiles="" 7trap 'rm -fr $tmpfiles' 1 2 3 15 8 9tmpfiles="$tmpfiles xg-c-11.c" 10cat <<\EOF > xg-c-11.c 11// (KDE) The 1-argument i18n macro is a simple gettext without context. 12print (i18n ("help")); 13// (KDE) The 2-argument i18n macro has the context first. 14print (i18n ("Help", "about")); 15// (KDE) The 3-argument i18n macro is an ngettext without context. 16print (i18n ("error", "errors", 7)); 17EOF 18 19tmpfiles="$tmpfiles 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 xg-c-11.c 24test $? = 0 || { rm -fr $tmpfiles; exit 1; } 25 26tmpfiles="$tmpfiles xg-c-11.ok" 27cat <<EOF > xg-c-11.ok 28msgid "help" 29msgstr "" 30 31msgctxt "Help" 32msgid "about" 33msgstr "" 34 35msgid "error" 36msgid_plural "errors" 37msgstr[0] "" 38msgstr[1] "" 39EOF 40 41: ${DIFF=diff} 42${DIFF} xg-c-11.ok xg-c-11.po 43result=$? 44 45rm -fr $tmpfiles 46 47exit $result 48