Home | History | Annotate | Line # | Download | only in tests
      1 #! /bin/sh
      2 
      3 # Test that untranslated messages that are brought over from the .pot file
      4 # get the right number of msgstrs.
      5 
      6 tmpfiles=""
      7 trap 'rm -fr $tmpfiles' 1 2 3 15
      8 
      9 tmpfiles="$tmpfiles mm-test17.po"
     10 cat <<\EOF > mm-test17.po
     11 # Irish translations.
     12 msgid ""
     13 msgstr ""
     14 "Content-Type: text/plain; charset=UTF-8\n"
     15 "Content-Transfer-Encoding: 8bit\n"
     16 "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;\n"
     17 
     18 #, c-format
     19 msgid "'Your command, please?', asked the waiter."
     20 msgstr ""
     21 EOF
     22 
     23 tmpfiles="$tmpfiles mm-test17.pot"
     24 cat <<\EOF > mm-test17.pot
     25 # SOME DESCRIPTIVE TITLE.
     26 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
     27 # This file is distributed under the same license as the PACKAGE package.
     28 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
     29 #
     30 #, fuzzy
     31 msgid ""
     32 msgstr ""
     33 "Project-Id-Version: PACKAGE VERSION\n"
     34 "Report-Msgid-Bugs-To: \n"
     35 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
     36 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     37 "Language-Team: LANGUAGE <LL (at] li.org>\n"
     38 "MIME-Version: 1.0\n"
     39 "Content-Type: text/plain; charset=CHARSET\n"
     40 "Content-Transfer-Encoding: 8bit\n"
     41 
     42 #, c-format
     43 msgid "'Your command, please?', asked the waiter."
     44 msgstr ""
     45 
     46 #, c-format
     47 msgid "a piece of cake"
     48 msgid_plural "%d pieces of cake"
     49 msgstr[0] ""
     50 msgstr[1] ""
     51 
     52 #, c-format
     53 msgid "%s is replaced by %s."
     54 msgstr ""
     55 EOF
     56 
     57 tmpfiles="$tmpfiles mm-test17.new.po"
     58 : ${MSGMERGE=msgmerge}
     59 ${MSGMERGE} -q -o mm-test17.new.po mm-test17.po mm-test17.pot
     60 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     61 
     62 tmpfiles="$tmpfiles mm-test17.ok"
     63 cat <<\EOF > mm-test17.ok
     64 # Irish translations.
     65 msgid ""
     66 msgstr ""
     67 "Report-Msgid-Bugs-To: \n"
     68 "Content-Type: text/plain; charset=UTF-8\n"
     69 "Content-Transfer-Encoding: 8bit\n"
     70 "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;\n"
     71 
     72 #, c-format
     73 msgid "'Your command, please?', asked the waiter."
     74 msgstr ""
     75 
     76 #, c-format
     77 msgid "a piece of cake"
     78 msgid_plural "%d pieces of cake"
     79 msgstr[0] ""
     80 msgstr[1] ""
     81 msgstr[2] ""
     82 
     83 #, c-format
     84 msgid "%s is replaced by %s."
     85 msgstr ""
     86 EOF
     87 
     88 : ${DIFF=diff}
     89 ${DIFF} mm-test17.ok mm-test17.new.po
     90 result=$?
     91 
     92 rm -fr $tmpfiles
     93 
     94 exit $result
     95