Home | History | Annotate | Line # | Download | only in tests
      1 #! /bin/sh
      2 
      3 # Test multi-domain handling.
      4 
      5 tmpfiles=""
      6 trap 'rm -fr $tmpfiles' 1 2 3 15
      7 
      8 tmpfiles="$tmpfiles mm-test7.po"
      9 cat <<\EOF > mm-test7.po
     10 domain "foo-de"
     11 msgid ""
     12 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
     13 
     14 # Das ist ein Kommentar.
     15 msgid "hello"
     16 msgstr "Hallo"
     17 
     18 # Noch einer.
     19 msgid "bye"
     20 msgstr "Tsch"
     21 
     22 domain "foo-fr"
     23 msgid ""
     24 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
     25 
     26 # Ceci est un commentaire.
     27 msgid "hello"
     28 msgstr "Salut"
     29 
     30 # Encore un.
     31 msgid "bye"
     32 msgstr "A bientt"
     33 EOF
     34 
     35 tmpfiles="$tmpfiles mm-test7.pot"
     36 cat <<EOF > mm-test7.pot
     37 domain "foo-de"
     38 msgid "Hello"
     39 msgstr ""
     40 domain "foo-fr"
     41 msgid "Hello"
     42 msgstr ""
     43 EOF
     44 
     45 tmpfiles="$tmpfiles mm-test7.out"
     46 : ${MSGMERGE=msgmerge}
     47 ${MSGMERGE} -q -o mm-test7.out mm-test7.po mm-test7.pot
     48 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     49 
     50 tmpfiles="$tmpfiles mm-test7.ok"
     51 cat <<\EOF > mm-test7.ok
     52 domain "foo-de"
     53 
     54 msgid ""
     55 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
     56 
     57 # Das ist ein Kommentar.
     58 #, fuzzy
     59 msgid "Hello"
     60 msgstr "Hallo"
     61 
     62 # Noch einer.
     63 #~ msgid "bye"
     64 #~ msgstr "Tsch"
     65 
     66 domain "foo-fr"
     67 
     68 msgid ""
     69 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
     70 
     71 # Ceci est un commentaire.
     72 #, fuzzy
     73 msgid "Hello"
     74 msgstr "Salut"
     75 
     76 # Encore un.
     77 #~ msgid "bye"
     78 #~ msgstr "A bientt"
     79 EOF
     80 
     81 : ${DIFF=diff}
     82 ${DIFF} mm-test7.ok mm-test7.out
     83 result=$?
     84 
     85 rm -fr $tmpfiles
     86 
     87 exit $result
     88