From: Bruno Haible Date: Thu, 8 Jan 2004 11:49:21 +0000 (+0000) Subject: Test the msgunfmt --csharp option. X-Git-Tag: v0.14~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cac746264cd0c7e8aee9a9613c464e359cf0fd53;p=thirdparty%2Fgettext.git Test the msgunfmt --csharp option. --- diff --git a/gettext-tools/tests/msgunfmt-csharp-1 b/gettext-tools/tests/msgunfmt-csharp-1 new file mode 100755 index 000000000..6829596b0 --- /dev/null +++ b/gettext-tools/tests/msgunfmt-csharp-1 @@ -0,0 +1,72 @@ +#! /bin/sh + +# Test of --csharp option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +# Test whether we can compile and execute C# programs. +test "${TESTCSHARP}" = yes || 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. +#, csharp-format +msgid "a piece of cake" +msgid_plural "{0} pieces of cake" +msgstr[0] "un morceau de gateau" +msgstr[1] "{0} morceaux de gateau" + +# Reverse the arguments. +#, csharp-format +msgid "{0} is replaced by {1}." +msgstr "{1} remplace {0}." +EOF + +tmpfiles="$tmpfiles fr/prog.resources.dll" +: ${MSGFMT=msgfmt} +GETTEXTCSHARPLIBDIR=../../gettext-runtime/intl-csharp \ +${MSGFMT} --csharp -d . -r prog -l fr fr.po || exit 1 + +tmpfiles="$tmpfiles prog.out" +: ${MSGUNFMT=msgunfmt} +GETTEXTCSHARPEXEDIR=../src \ +GETTEXTCSHARPLIBDIR=../../gettext-runtime/intl-csharp \ +${MSGUNFMT} --csharp -d . -r prog -l fr -o prog.out || exit 1 + +tmpfiles="$tmpfiles prog.sort" +: ${MSGCAT=msgcat} +${MSGCAT} -s prog.out -o prog.sort || 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 "'Your command, please?', asked the waiter." +msgstr "«Votre commande, s'il vous plait», dit le garçon." + +msgid "a piece of cake" +msgid_plural "{0} pieces of cake" +msgstr[0] "un morceau de gateau" +msgstr[1] "{0} morceaux de gateau" + +msgid "{0} is replaced by {1}." +msgstr "{1} remplace {0}." +EOF +: ${DIFF=diff} +${DIFF} prog.ok prog.sort || exit 1 + +rm -fr $tmpfiles + +exit 0