No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / msgfmt-5
blob4da5bb52b0086b3263ad1892027ce29ed1ed62eb
1 #! /bin/sh
3 # Test multi-domain handling.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles foo.po"
9 cat <<\EOF > foo.po
10 domain "foo-de"
11 msgid ""
12 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
14 # Das ist ein Kommentar.
15 msgid "hello"
16 msgstr "Hallo"
18 # Noch einer.
19 msgid "bye"
20 msgstr "Tschüß"
22 domain "foo-fr"
23 msgid ""
24 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
26 # Ceci est un commentaire.
27 msgid "hello"
28 msgstr "Salut"
30 # Encore un.
31 msgid "bye"
32 msgstr "A bientôt"
33 EOF
35 tmpfiles="$tmpfiles foo-de.mo foo-fr.mo"
36 : ${MSGFMT=msgfmt}
37 ${MSGFMT} foo.po
38 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
40 tmpfiles="$tmpfiles foo-de.out foo-fr.out"
41 : ${MSGUNFMT=msgunfmt}
42 ${MSGUNFMT} foo-de.mo -o foo-de.out
43 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
44 ${MSGUNFMT} foo-fr.mo -o foo-fr.out
45 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
47 tmpfiles="$tmpfiles foo-de.ok"
48 cat <<\EOF > foo-de.ok
49 msgid ""
50 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
52 msgid "bye"
53 msgstr "Tschüß"
55 msgid "hello"
56 msgstr "Hallo"
57 EOF
59 tmpfiles="$tmpfiles foo-fr.ok"
60 cat <<\EOF > foo-fr.ok
61 msgid ""
62 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
64 msgid "bye"
65 msgstr "A bientôt"
67 msgid "hello"
68 msgstr "Salut"
69 EOF
71 : ${DIFF=diff}
72 ${DIFF} foo-de.ok foo-de.out && ${DIFF} foo-fr.ok foo-fr.out
73 result=$?
75 rm -fr $tmpfiles
77 exit $result