78 lines
1.3 KiB
Bash
78 lines
1.3 KiB
Bash
#! /bin/sh
|
|
|
|
# Test multi-domain handling.
|
|
|
|
tmpfiles=""
|
|
trap 'rm -fr $tmpfiles' 1 2 3 15
|
|
|
|
tmpfiles="$tmpfiles foo.po"
|
|
cat <<\EOF > foo.po
|
|
domain "foo-de"
|
|
msgid ""
|
|
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
|
|
|
|
# Das ist ein Kommentar.
|
|
msgid "hello"
|
|
msgstr "Hallo"
|
|
|
|
# Noch einer.
|
|
msgid "bye"
|
|
msgstr "Tschüß"
|
|
|
|
domain "foo-fr"
|
|
msgid ""
|
|
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
|
|
|
|
# Ceci est un commentaire.
|
|
msgid "hello"
|
|
msgstr "Salut"
|
|
|
|
# Encore un.
|
|
msgid "bye"
|
|
msgstr "A bientôt"
|
|
EOF
|
|
|
|
tmpfiles="$tmpfiles foo-de.mo foo-fr.mo"
|
|
: ${MSGFMT=msgfmt}
|
|
${MSGFMT} foo.po
|
|
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
|
|
|
|
tmpfiles="$tmpfiles foo-de.out foo-fr.out"
|
|
: ${MSGUNFMT=msgunfmt}
|
|
${MSGUNFMT} foo-de.mo -o foo-de.out
|
|
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
|
|
${MSGUNFMT} foo-fr.mo -o foo-fr.out
|
|
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
|
|
|
|
tmpfiles="$tmpfiles foo-de.ok"
|
|
cat <<\EOF > foo-de.ok
|
|
msgid ""
|
|
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
|
|
|
|
msgid "bye"
|
|
msgstr "Tschüß"
|
|
|
|
msgid "hello"
|
|
msgstr "Hallo"
|
|
EOF
|
|
|
|
tmpfiles="$tmpfiles foo-fr.ok"
|
|
cat <<\EOF > foo-fr.ok
|
|
msgid ""
|
|
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
|
|
|
|
msgid "bye"
|
|
msgstr "A bientôt"
|
|
|
|
msgid "hello"
|
|
msgstr "Salut"
|
|
EOF
|
|
|
|
: ${DIFF=diff}
|
|
${DIFF} foo-de.ok foo-de.out && ${DIFF} foo-fr.ok foo-fr.out
|
|
result=$?
|
|
|
|
rm -fr $tmpfiles
|
|
|
|
exit $result
|