1#! /bin/sh 2. "${srcdir=.}/init.sh"; path_prepend_ . ../src 3 4# Test msginit on a POT file with contexts. 5 6cat <<\EOF > mi-test2.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=UTF-8\n" 23"Content-Transfer-Encoding: 8bit\n" 24 25#. A menu item 26msgctxt "File|" 27msgid "Open" 28msgstr "" 29 30#. A menu item 31msgctxt "File|" 32msgid "New" 33msgstr "" 34 35#. Denote a lock's state 36msgctxt "Lock state" 37msgid "Open" 38msgstr "" 39 40#. Denote a lock's state 41msgctxt "Lock state" 42msgid "Closed" 43msgstr "" 44 45#. A product 46msgctxt "Audi" 47msgid "car" 48msgstr "" 49 50#. A product 51msgctxt "Océ" 52msgid "copier" 53msgstr "" 54 55#~ msgid "Save As" 56#~ msgstr "" 57 58#. A menu item 59#~ msgctxt "File|" 60#~ msgid "Save As" 61#~ msgstr "" 62EOF 63 64: ${MSGINIT=msginit} 65${MSGINIT} -i mi-test2.pot -l ga_IE --no-translator -o mi-test2.tmp 2>mi-test2.err 66test $? = 0 || { cat mi-test2.err 1>&2; Exit 1; } 67sed -e '1,10d' < mi-test2.tmp | LC_ALL=C tr -d '\r' > mi-test2.out || Exit 1 68 69cat <<\EOF > mi-test2.ok 70"Last-Translator: Automatically generated\n" 71"Language-Team: none\n" 72"Language: ga\n" 73"MIME-Version: 1.0\n" 74"Content-Type: text/plain; charset=UTF-8\n" 75"Content-Transfer-Encoding: 8bit\n" 76"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;\n" 77 78#. A menu item 79msgctxt "File|" 80msgid "Open" 81msgstr "" 82 83#. A menu item 84msgctxt "File|" 85msgid "New" 86msgstr "" 87 88#. Denote a lock's state 89msgctxt "Lock state" 90msgid "Open" 91msgstr "" 92 93#. Denote a lock's state 94msgctxt "Lock state" 95msgid "Closed" 96msgstr "" 97 98#. A product 99msgctxt "Audi" 100msgid "car" 101msgstr "" 102 103#. A product 104msgctxt "Océ" 105msgid "copier" 106msgstr "" 107EOF 108 109: ${DIFF=diff} 110${DIFF} mi-test2.ok mi-test2.out 111result=$? 112 113exit $result 114