Home | History | Annotate | Line # | Download | only in tests
xgettext-3 revision 1.1
      1  1.1  christos #! /bin/sh
      2  1.1  christos 
      3  1.1  christos # When a header entry is provided by xgettext, it overrides any msgid ""
      4  1.1  christos # present in the input.
      5  1.1  christos 
      6  1.1  christos tmpfiles=""
      7  1.1  christos trap 'rm -fr $tmpfiles' 1 2 3 15
      8  1.1  christos 
      9  1.1  christos tmpfiles="$tmpfiles xg-test3.in.c"
     10  1.1  christos cat <<EOF > xg-test3.in.c
     11  1.1  christos This is a test of the xgettext functionality.
     12  1.1  christos /* xgettext:no-c-format */
     13  1.1  christos _("extract me")
     14  1.1  christos Sometimes keywords can be spread apart
     15  1.1  christos xgettext:no-c-format
     16  1.1  christos _ ( "what about me" )
     17  1.1  christos And even further on accasion
     18  1.1  christos _
     19  1.1  christos (
     20  1.1  christos "hello"
     21  1.1  christos )
     22  1.1  christos 
     23  1.1  christos /* no additional empty strings */
     24  1.1  christos _("")
     25  1.1  christos EOF
     26  1.1  christos 
     27  1.1  christos tmpfiles="$tmpfiles xg-test3.po"
     28  1.1  christos : ${XGETTEXT=xgettext}
     29  1.1  christos # delete POT-Creation-Date: line because the date depends on local time.
     30  1.1  christos ${XGETTEXT} --output - --no-location -k_ xg-test3.in.c 2>/dev/null \
     31  1.1  christos   | sed '/\"POT-Creation-Date:.*/d' > xg-test3.po
     32  1.1  christos 
     33  1.1  christos tmpfiles="$tmpfiles xg-test3.ok"
     34  1.1  christos cat <<EOF > xg-test3.ok
     35  1.1  christos # SOME DESCRIPTIVE TITLE.
     36  1.1  christos # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
     37  1.1  christos # This file is distributed under the same license as the PACKAGE package.
     38  1.1  christos # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
     39  1.1  christos #
     40  1.1  christos #, fuzzy
     41  1.1  christos msgid ""
     42  1.1  christos msgstr ""
     43  1.1  christos "Project-Id-Version: PACKAGE VERSION\n"
     44  1.1  christos "Report-Msgid-Bugs-To: \n"
     45  1.1  christos "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
     46  1.1  christos "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     47  1.1  christos "Language-Team: LANGUAGE <LL (at] li.org>\n"
     48  1.1  christos "MIME-Version: 1.0\n"
     49  1.1  christos "Content-Type: text/plain; charset=CHARSET\n"
     50  1.1  christos "Content-Transfer-Encoding: 8bit\n"
     51  1.1  christos 
     52  1.1  christos #, no-c-format
     53  1.1  christos msgid "extract me"
     54  1.1  christos msgstr ""
     55  1.1  christos 
     56  1.1  christos msgid "what about me"
     57  1.1  christos msgstr ""
     58  1.1  christos 
     59  1.1  christos msgid "hello"
     60  1.1  christos msgstr ""
     61  1.1  christos EOF
     62  1.1  christos 
     63  1.1  christos : ${DIFF=diff}
     64  1.1  christos ${DIFF} xg-test3.ok xg-test3.po
     65  1.1  christos result=$?
     66  1.1  christos 
     67  1.1  christos rm -fr $tmpfiles
     68  1.1  christos 
     69  1.1  christos exit $result
     70