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