No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / msgunfmt-java-1
blob031c9b9c9f38edd64ee0cee2365a5f5cae12e1ac
1 #! /bin/sh
3 # Test of --java option.
5 # Note: This test fails when using gcj from GCC 3.1 and GCC 3.2, due to a bug
6 # (libgcj/6576). It is fixed in GCC 3.3.
8 tmpfiles=""
9 trap 'rm -fr $tmpfiles' 1 2 3 15
11 # Test whether we can compile and execute Java programs.
12 test "${TESTJAVA}" = yes || exit 77
14 tmpfiles="$tmpfiles fr.po"
15 cat <<\EOF > fr.po
16 msgid ""
17 msgstr ""
18 "Content-Type: text/plain; charset=ISO-8859-1\n"
19 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
21 msgid "'Your command, please?', asked the waiter."
22 msgstr "«Votre commande, s'il vous plait», dit le garçon."
24 # Les gateaux allemands sont les meilleurs du monde.
25 #, java-format
26 msgid "a piece of cake"
27 msgid_plural "{0,number} pieces of cake"
28 msgstr[0] "un morceau de gateau"
29 msgstr[1] "{0,number} morceaux de gateau"
31 # Reverse the arguments.
32 #, java-format
33 msgid "{0} is replaced by {1}."
34 msgstr "{1} remplace {0}."
35 EOF
37 tmpfiles="$tmpfiles prog_fr.class"
38 : ${MSGFMT=msgfmt}
39 ${MSGFMT} -j -d . -r prog -l fr fr.po || exit 1
41 tmpfiles="$tmpfiles prog.out"
42 : ${MSGUNFMT=msgunfmt}
43 CLASSPATH=.${CLASSPATH:+:$CLASSPATH} \
44 GETTEXTJEXEDIR=../src GETTEXTJAR=../src/gettext.jar \
45 ${MSGUNFMT} --java -d . -r prog -l fr -o prog.out || exit 1
47 tmpfiles="$tmpfiles prog.sort"
48 : ${MSGCAT=msgcat}
49 ${MSGCAT} -s prog.out -o prog.sort || exit 1
51 tmpfiles="$tmpfiles prog.ok"
52 cat <<\EOF > prog.ok
53 msgid ""
54 msgstr ""
55 "Content-Type: text/plain; charset=UTF-8\n"
56 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
58 msgid "'Your command, please?', asked the waiter."
59 msgstr "«Votre commande, s'il vous plait», dit le garçon."
61 msgid "a piece of cake"
62 msgid_plural "{0,number} pieces of cake"
63 msgstr[0] "un morceau de gateau"
64 msgstr[1] "{0,number} morceaux de gateau"
66 msgid "{0} is replaced by {1}."
67 msgstr "{1} remplace {0}."
68 EOF
69 : ${DIFF=diff}
70 ${DIFF} prog.ok prog.sort || exit 1
72 rm -fr $tmpfiles
74 exit 0