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