1 1.1 christos #!/bin/sh 2 1.1 christos # 3 1.1 christos # Some tests for java plural keyword support 4 1.1 christos # 5 1.1 christos 6 1.1 christos tmpfiles="" 7 1.1 christos trap 'rm -fr $tmpfiles' 1 2 3 15 8 1.1 christos 9 1.1 christos tmpfiles="$tmpfiles xg-j-4.java" 10 1.1 christos cat <<EOF > xg-j-4.java 11 1.1 christos class TestCase { 12 1.1 christos public TestCase() { 13 1.1 christos Bundle test = Bundle.getBundle(); 14 1.1 christos test.ngettext(test, "test 1", "plural test"); 15 1.1 christos } 16 1.1 christos } 17 1.1 christos EOF 18 1.1 christos 19 1.1 christos tmpfiles="$tmpfiles xg-j-4.po" 20 1.1 christos : ${XGETTEXT=xgettext} 21 1.1 christos ${XGETTEXT} --omit-header --no-location --keyword=ngettext:2,3 -d xg-j-4 xg-j-4.java 22 1.1 christos test $? = 0 || { rm -fr $tmpfiles; exit 1; } 23 1.1 christos 24 1.1 christos tmpfiles="$tmpfiles xg-j-4.ok" 25 1.1 christos cat <<EOF > xg-j-4.ok 26 1.1 christos msgid "test 1" 27 1.1 christos msgid_plural "plural test" 28 1.1 christos msgstr[0] "" 29 1.1 christos msgstr[1] "" 30 1.1 christos EOF 31 1.1 christos 32 1.1 christos : ${DIFF=diff} 33 1.1 christos ${DIFF} xg-j-4.ok xg-j-4.po 34 1.1 christos result=$? 35 1.1 christos 36 1.1 christos rm -fr $tmpfiles 37 1.1 christos 38 1.1 christos exit $result 39