]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Better support for PO files containing multiple domains.
authorBruno Haible <bruno@clisp.org>
Mon, 11 Jun 2001 20:05:34 +0000 (20:05 +0000)
committerBruno Haible <bruno@clisp.org>
Mon, 11 Jun 2001 20:05:34 +0000 (20:05 +0000)
tests/msgmerge-10 [new file with mode: 0755]
tests/msgmerge-11 [new file with mode: 0755]

diff --git a/tests/msgmerge-10 b/tests/msgmerge-10
new file mode 100755 (executable)
index 0000000..0441cc3
--- /dev/null
@@ -0,0 +1,86 @@
+#! /bin/sh
+
+# Test multi-domain handling.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+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.pot"
+cat <<EOF > foo.pot
+domain "foo-de"
+msgid "Hello"
+msgstr ""
+domain "foo-fr"
+msgid "Hello"
+msgstr ""
+EOF
+
+tmpfiles="$tmpfiles foo.out"
+: ${MSGMERGE=msgmerge}
+${MSGMERGE} -q foo.po foo.pot -o foo.out
+
+tmpfiles="$tmpfiles foo.ok"
+cat <<EOF > foo.ok
+domain "foo-de"
+
+msgid ""
+msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
+
+# Das ist ein Kommentar.
+#, fuzzy
+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.
+#, fuzzy
+msgid "Hello"
+msgstr "Salut"
+
+# Encore un.
+#~ msgid "bye"
+#~ msgstr "A bientôt"
+EOF
+
+: ${DIFF=diff}
+${DIFF} foo.ok foo.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgmerge-11 b/tests/msgmerge-11
new file mode 100755 (executable)
index 0000000..8c4d2c8
--- /dev/null
@@ -0,0 +1,82 @@
+#! /bin/sh
+
+# Test multi-domain handling.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+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.pot"
+cat <<EOF > foo.pot
+msgid "Hello"
+msgstr ""
+EOF
+
+tmpfiles="$tmpfiles foo.out"
+: ${MSGMERGE=msgmerge}
+${MSGMERGE} --multi-domain -q foo.po foo.pot -o foo.out
+
+tmpfiles="$tmpfiles foo.ok"
+cat <<EOF > foo.ok
+domain "foo-de"
+
+msgid ""
+msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
+
+# Das ist ein Kommentar.
+#, fuzzy
+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.
+#, fuzzy
+msgid "Hello"
+msgstr "Salut"
+
+# Encore un.
+#~ msgid "bye"
+#~ msgstr "A bientôt"
+EOF
+
+: ${DIFF=diff}
+${DIFF} foo.ok foo.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result