1#! /bin/sh 2 3# Test multi-domain handling. 4 5tmpfiles="" 6trap 'rm -fr $tmpfiles' 1 2 3 15 7 8tmpfiles="$tmpfiles foo.po" 9cat <<\EOF > foo.po 10domain "foo-de" 11msgid "" 12msgstr "Content-Type: text/plain; charset=ISO-8859-1\n" 13 14# Das ist ein Kommentar. 15msgid "hello" 16msgstr "Hallo" 17 18# Noch einer. 19msgid "bye" 20msgstr "Tsch��" 21 22domain "foo-fr" 23msgid "" 24msgstr "Content-Type: text/plain; charset=ISO-8859-1\n" 25 26# Ceci est un commentaire. 27msgid "hello" 28msgstr "Salut" 29 30# Encore un. 31msgid "bye" 32msgstr "A bient�t" 33EOF 34 35tmpfiles="$tmpfiles foo-de.mo foo-fr.mo" 36: ${MSGFMT=msgfmt} 37${MSGFMT} foo.po 38test $? = 0 || { rm -fr $tmpfiles; exit 1; } 39 40tmpfiles="$tmpfiles foo-de.out foo-fr.out" 41: ${MSGUNFMT=msgunfmt} 42${MSGUNFMT} -o foo-de.out foo-de.mo 43test $? = 0 || { rm -fr $tmpfiles; exit 1; } 44${MSGUNFMT} -o foo-fr.out foo-fr.mo 45test $? = 0 || { rm -fr $tmpfiles; exit 1; } 46 47tmpfiles="$tmpfiles foo-de.ok" 48cat <<\EOF > foo-de.ok 49msgid "" 50msgstr "Content-Type: text/plain; charset=ISO-8859-1\n" 51 52msgid "bye" 53msgstr "Tsch��" 54 55msgid "hello" 56msgstr "Hallo" 57EOF 58 59tmpfiles="$tmpfiles foo-fr.ok" 60cat <<\EOF > foo-fr.ok 61msgid "" 62msgstr "Content-Type: text/plain; charset=ISO-8859-1\n" 63 64msgid "bye" 65msgstr "A bient�t" 66 67msgid "hello" 68msgstr "Salut" 69EOF 70 71: ${DIFF=diff} 72${DIFF} foo-de.ok foo-de.out && ${DIFF} foo-fr.ok foo-fr.out 73result=$? 74 75rm -fr $tmpfiles 76 77exit $result 78