Home | History | Annotate | Line # | Download | only in tests
      1 #!/bin/sh
      2 
      3 # Test of Perl support with UTF-8 encoded input.
      4 
      5 tmpfiles=""
      6 trap 'rm -fr $tmpfiles' 1 2 3 15
      7 
      8 tmpfiles="$tmpfiles xg-pl-3.pl"
      9 cat <<\EOF > xg-pl-3.pl
     10 use charnames ':full';
     11 printf "%s\n", gettext "Bse Bbchen - wo sind sie blo\N{LATIN SMALL LETTER SHARP S}?";
     12 print gettext <<STR
     13 Die europische Whrung ist \N{EURO SIGN}.
     14 STR
     15 EOF
     16 
     17 tmpfiles="$tmpfiles xg-pl-3.po"
     18 : ${XGETTEXT=xgettext}
     19 # delete POT-Creation-Date: line because the date depends on local time.
     20 ${XGETTEXT} --output - --from-code=UTF-8 xg-pl-3.pl \
     21   | sed '/\"POT-Creation-Date:.*/d' > xg-pl-3.po
     22 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     23 
     24 tmpfiles="$tmpfiles xg-pl-3.ok"
     25 cat <<\EOF > xg-pl-3.ok
     26 # SOME DESCRIPTIVE TITLE.
     27 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
     28 # This file is distributed under the same license as the PACKAGE package.
     29 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
     30 #
     31 #, fuzzy
     32 msgid ""
     33 msgstr ""
     34 "Project-Id-Version: PACKAGE VERSION\n"
     35 "Report-Msgid-Bugs-To: \n"
     36 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
     37 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     38 "Language-Team: LANGUAGE <LL (at] li.org>\n"
     39 "MIME-Version: 1.0\n"
     40 "Content-Type: text/plain; charset=UTF-8\n"
     41 "Content-Transfer-Encoding: 8bit\n"
     42 
     43 #: xg-pl-3.pl:2
     44 msgid "Bse Bbchen - wo sind sie blo?"
     45 msgstr ""
     46 
     47 #: xg-pl-3.pl:4
     48 msgid "Die europische Whrung ist .\n"
     49 msgstr ""
     50 EOF
     51 
     52 : ${DIFF=diff}
     53 ${DIFF} xg-pl-3.ok xg-pl-3.po
     54 result=$?
     55 
     56 rm -fr $tmpfiles
     57 
     58 exit $result
     59