1#! /bin/sh 2. "${srcdir=.}/init.sh"; path_prepend_ . ../src 3 4# Test msgmerge and msgcmp on a PO file with contexts. 5 6cat <<\EOF > mm-test18.po 7msgid "" 8msgstr "" 9"Content-Type: text/plain; charset=UTF-8\n" 10"Content-Transfer-Encoding: 8bit\n" 11 12#. A menu item 13msgctxt "File|" 14msgid "Open" 15msgstr "Ouvrir" 16 17#. A menu item 18msgctxt "File|" 19msgid "New" 20msgstr "Nouveau" 21 22#. A menu item 23msgctxt "File|" 24msgid "Save As" 25msgstr "Enregistrer sous" 26 27msgid "Save As" 28msgstr "Enregistrer l'as" 29 30#. Denote a lock's state 31msgctxt "Lock state" 32msgid "Open" 33msgstr "Ouvert" 34 35#. Denote a lock's state 36msgctxt "Lock state" 37msgid "Closed" 38msgstr "Fermé" 39 40#. A product 41msgctxt "Audi" 42msgid "car" 43msgstr "voiture" 44 45#. A product 46msgctxt "Océ" 47msgid "copier" 48msgstr "photocopieur" 49EOF 50 51cat <<\EOF > mm-test18.pot 52# SOME DESCRIPTIVE TITLE. 53# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 54# This file is distributed under the same license as the PACKAGE package. 55# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 56# 57#, fuzzy 58msgid "" 59msgstr "" 60"Project-Id-Version: PACKAGE VERSION\n" 61"Report-Msgid-Bugs-To: \n" 62"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 63"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 64"Language-Team: LANGUAGE <LL@li.org>\n" 65"MIME-Version: 1.0\n" 66"Content-Type: text/plain; charset=UTF-8\n" 67"Content-Transfer-Encoding: 8bit\n" 68 69#. A menu item 70msgctxt "File|" 71msgid "Open" 72msgstr "" 73 74#. A menu item 75msgctxt "File|" 76msgid "New" 77msgstr "" 78 79#. A menu item 80msgctxt "File|" 81msgid "Close" 82msgstr "" 83 84#. Denote a lock's state 85msgctxt "Lock state" 86msgid "Open" 87msgstr "" 88 89#. Denote a lock's state 90msgctxt "Lock state" 91msgid "Closed" 92msgstr "" 93 94#. Denote a door's state 95msgctxt "Door state" 96msgid "Open" 97msgstr "" 98 99#. Denote a door's state 100msgctxt "Door state" 101msgid "Closed" 102msgstr "" 103 104#. A product 105msgctxt "Audi" 106msgid "car" 107msgstr "" 108 109#. A product 110msgctxt "Océ" 111msgid "copier" 112msgstr "" 113EOF 114 115: ${MSGCMP=msgcmp} 116${MSGCMP} --use-fuzzy --use-untranslated mm-test18.po mm-test18.pot 2>/dev/null 117test $? = 1 || { Exit 1; } 118 119: ${MSGMERGE=msgmerge} 120${MSGMERGE} -q -o mm-test18.tmp.po mm-test18.po mm-test18.pot || Exit 1 121LC_ALL=C tr -d '\r' < mm-test18.tmp.po > mm-test18.new.po || Exit 1 122 123# Note that the fuzzy guess for "Open" in context "Door state" could be either 124# "Ouvrir" (from context "File|") or "Ouvert" (from context "Lock state"). 125cat <<\EOF > mm-test18.ok 126msgid "" 127msgstr "" 128"Report-Msgid-Bugs-To: \n" 129"Content-Type: text/plain; charset=UTF-8\n" 130"Content-Transfer-Encoding: 8bit\n" 131 132#. A menu item 133msgctxt "File|" 134msgid "Open" 135msgstr "Ouvrir" 136 137#. A menu item 138msgctxt "File|" 139msgid "New" 140msgstr "Nouveau" 141 142#. A menu item 143#, fuzzy 144msgctxt "File|" 145msgid "Close" 146msgstr "Fermé" 147 148#. Denote a lock's state 149msgctxt "Lock state" 150msgid "Open" 151msgstr "Ouvert" 152 153#. Denote a lock's state 154msgctxt "Lock state" 155msgid "Closed" 156msgstr "Fermé" 157 158#. Denote a door's state 159#, fuzzy 160msgctxt "Door state" 161msgid "Open" 162msgstr "Ouvrir" 163 164#. Denote a door's state 165#, fuzzy 166msgctxt "Door state" 167msgid "Closed" 168msgstr "Fermé" 169 170#. A product 171msgctxt "Audi" 172msgid "car" 173msgstr "voiture" 174 175#. A product 176msgctxt "Océ" 177msgid "copier" 178msgstr "photocopieur" 179 180#~ msgctxt "File|" 181#~ msgid "Save As" 182#~ msgstr "Enregistrer sous" 183 184#~ msgid "Save As" 185#~ msgstr "Enregistrer l'as" 186EOF 187 188: ${DIFF=diff} 189${DIFF} mm-test18.ok mm-test18.new.po || Exit 1 190 191: ${MSGCMP=msgcmp} 192${MSGCMP} --use-fuzzy --use-untranslated mm-test18.new.po mm-test18.pot || Exit 1 193 194Exit 0 195