+2002-03-10 Bruno Haible <bruno@clisp.org>
+
+ * msgunfmt-2: New file.
+ * msgunfmt-3: New file.
+ * Makefile.am (TESTS): Add them.
+
2002-03-07 Bruno Haible <bruno@clisp.org>
* lang-gawk: Fix the version recognition, to work with gawk 2.xx.
msgmerge-7 msgmerge-8 msgmerge-9 msgmerge-10 msgmerge-11 msgmerge-12 \
msgmerge-13 msgmerge-14 msgmerge-15 msgmerge-16 msgmerge-17 \
msgmerge-18 msgmerge-19 msgmerge-20 \
- msgunfmt-1 \
+ msgunfmt-1 msgunfmt-2 msgunfmt-3 \
msguniq-1 msguniq-2 msguniq-3 \
xgettext-1 xgettext-2 xgettext-3 xgettext-4 xgettext-5 xgettext-6 \
xgettext-7 xgettext-8 xgettext-9 xgettext-10 xgettext-11 xgettext-12 \
--- /dev/null
+#! /bin/sh
+
+# Test of --java option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+# Test whether we can compile and execute Java programs.
+test "${TESTJAVA}" = yes || { echo "SKIP: msgunfmt-2"; exit 77; }
+
+tmpfiles="$tmpfiles fr.po"
+cat <<\EOF > fr.po
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+msgid "'Your command, please?', asked the waiter."
+msgstr "«Votre commande, s'il vous plait», dit le garçon."
+
+# Les gateaux allemands sont les meilleurs du monde.
+#, java-format
+msgid "a piece of cake"
+msgid_plural "{0,number} pieces of cake"
+msgstr[0] "un morceau de gateau"
+msgstr[1] "{0,number} morceaux de gateau"
+
+# Reverse the arguments.
+#, java-format
+msgid "{0} is replaced by {1}."
+msgstr "{1} remplace {0}."
+EOF
+
+tmpfiles="$tmpfiles prog_fr.class"
+: ${MSGFMT=msgfmt}
+${MSGFMT} -j -d . -r prog -l fr fr.po || exit 1
+
+tmpfiles="$tmpfiles prog.out"
+: ${MSGUNFMT=msgunfmt}
+GETTEXTJAR=../src/gettext.jar \
+${MSGUNFMT} --java -d . -r prog -l fr -o prog.out || exit 1
+
+tmpfiles="$tmpfiles prog.ok"
+cat <<\EOF > prog.ok
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+msgid "a piece of cake"
+msgid_plural "{0,number} pieces of cake"
+msgstr[0] "un morceau de gateau"
+msgstr[1] "{0,number} morceaux de gateau"
+
+msgid "'Your command, please?', asked the waiter."
+msgstr "«Votre commande, s'il vous plait», dit le garçon."
+
+msgid "{0} is replaced by {1}."
+msgstr "{1} remplace {0}."
+EOF
+: ${DIFF=diff}
+${DIFF} prog.ok prog.out || exit 1
+
+rm -fr $tmpfiles
+
+exit 0
--- /dev/null
+#! /bin/sh
+
+# Test of --tcl option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+# Test whether we can execute Tcl programs.
+tmpfiles="$tmpfiles version.tcl"
+cat <<\EOF > version.tcl
+puts $tcl_version
+EOF
+(tclsh version.tcl) >/dev/null 2>/dev/null \
+ || { echo "SKIP: msgunfmt-3"; rm -fr $tmpfiles; exit 77; }
+
+tmpfiles="$tmpfiles fr.po"
+cat <<\EOF > fr.po
+msgid ""
+msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
+
+#: program.tcl:5
+msgid "'Your command, please?', asked the waiter."
+msgstr "«Votre commande, s'il vous plait», dit le garçon."
+
+# Reverse the arguments.
+#: program.tcl:6
+#, tcl-format
+msgid "%s is replaced by %s."
+msgstr "%2$s remplace %1$s."
+EOF
+
+tmpfiles="$tmpfiles msgs"
+test -d msgs || mkdir msgs
+
+: ${MSGFMT=msgfmt}
+${MSGFMT} --tcl -d msgs -l fr fr.po || exit 1
+
+tmpfiles="$tmpfiles prog.out"
+: ${MSGUNFMT=msgunfmt}
+GETTEXTDATADIR=../src \
+${MSGUNFMT} --tcl -d msgs -l fr -o prog.out || exit 1
+
+tmpfiles="$tmpfiles prog.ok"
+cat <<\EOF > prog.ok
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8\n"
+
+msgid "'Your command, please?', asked the waiter."
+msgstr "«Votre commande, s'il vous plait», dit le garçon."
+
+msgid "%s is replaced by %s."
+msgstr "%2$s remplace %1$s."
+EOF
+: ${DIFF=diff}
+${DIFF} prog.ok prog.out || exit 1
+
+rm -fr $tmpfiles
+
+exit 0