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