• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test various msginit options.
5
6# This test fails on mingw, because it relies on the 'project-id' script,
7# which is a shell script (for maintainability) and there is no simple way
8# to execute shell scripts in a native Windows environment.
9# People who need this functionality should use a Cygwin environment, not
10# a native Windows environment.
11
12cat <<\EOF > mi-test3.pot
13# SOME DESCRIPTIVE TITLE.
14# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
15# This file is distributed under the same license as the PACKAGE package.
16# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
17#
18#, fuzzy
19msgid ""
20msgstr ""
21"Project-Id-Version: PACKAGE VERSION\n"
22"Report-Msgid-Bugs-To: \n"
23"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
24"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
25"Language-Team: LANGUAGE <LL@li.org>\n"
26"Language: \n"
27"MIME-Version: 1.0\n"
28"Content-Type: text/plain; charset=CHARSET\n"
29"Content-Transfer-Encoding: 8bit\n"
30
31#, c-format
32msgid "'Your command, please?', asked the waiter."
33msgstr ""
34
35#, c-format
36msgid "a piece of cake"
37msgid_plural "%d pieces of cake"
38msgstr[0] ""
39msgstr[1] ""
40
41#, c-format
42msgid "%s is replaced by %s."
43msgstr ""
44EOF
45
46: ${MSGINIT=msginit}
47GETTEXTLIBDIR_SRCDIR="$wabs_top_srcdir"/src \
48${MSGINIT} -l ga_IE --no-translator -o mi-test3.tmp 2>mi-test3.err
49test $? = 0 || { cat mi-test3.err 1>&2; Exit 1; }
50
51grep "Project-Id-Version: gt-msginit " mi-test3.tmp 2>&1 >/dev/null || Exit 1
52
53# The charset stored in the header entry is the locale encoding of the gl_IE
54# locale, which is system dependent, or ASCII if the locale does not exist.
55#
56# Project-Id-Version contains version constructed from a temporary
57# directory name
58sed -e '1,10d' -e 's/ISO-8859-1/ASCII/g' -e 's/CP1252/ASCII/g' -e 's/UTF-8/ASCII/g' < mi-test3.tmp | grep -v Project-Id-Version | LC_ALL=C tr -d '\r' > mi-test3.out || Exit 1
59cat <<\EOF > mi-test3.ok
60"Last-Translator: Automatically generated\n"
61"Language-Team: none\n"
62"Language: ga\n"
63"MIME-Version: 1.0\n"
64"Content-Type: text/plain; charset=ASCII\n"
65"Content-Transfer-Encoding: 8bit\n"
66"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;\n"
67
68#, c-format
69msgid "'Your command, please?', asked the waiter."
70msgstr ""
71
72#, c-format
73msgid "a piece of cake"
74msgid_plural "%d pieces of cake"
75msgstr[0] ""
76msgstr[1] ""
77msgstr[2] ""
78
79#, c-format
80msgid "%s is replaced by %s."
81msgstr ""
82EOF
83
84: ${DIFF=diff}
85${DIFF} mi-test3.ok mi-test3.out
86result=$?
87
88exit $result
89