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