1#! /bin/sh 2. "${srcdir=.}/init.sh"; path_prepend_ . ../src 3 4# Test --for-msgfmt option. 5 6cat <<EOF > mm-test26.in1 7#: fruits.c:14 8msgid "cherry" 9msgstr "cerise" 10 11#: fruits.c:17 12msgid "pear" 13msgstr "poire" 14 15#: fruits.c:19 16msgid "orange" 17msgstr "" 18 19#, fuzzy 20#: fruits.c:20 21msgid "apple" 22msgstr "pommes" 23EOF 24 25cat <<EOF > mm-test26.in2 26# Fuzzy already in the PO file. 27#: fruits.c:10 28msgid "apple" 29msgstr "" 30 31# Fuzzy match to fuzzy already in the PO file. 32#: fruits.c:11 33msgid "apples" 34msgstr "" 35 36# Translated. 37#: fruits.c:16 38msgid "pear" 39msgstr "" 40 41# Fuzzy match. 42#: fruits.c:17 43msgid "pears" 44msgstr "" 45 46# Untranslated, in the PO file. 47#: fruits.c:18 48msgid "orange" 49msgstr "" 50 51# Untranslated, not in the PO file. 52#: fruits.c:20 53msgid "banana" 54msgstr "" 55 56# Translated already in the POT file. 57#: fruits.c:25 58msgid "papaya" 59msgstr "Papaya" 60EOF 61 62: ${MSGMERGE=msgmerge} 63${MSGMERGE} --for-msgfmt -o mm-test26.tmp mm-test26.in1 mm-test26.in2 \ 64 || Exit 1 65LC_ALL=C tr -d '\r' < mm-test26.tmp > mm-test26.out || Exit 1 66 67cat << EOF > mm-test26.ok 68msgid "pear" 69msgstr "poire" 70 71msgid "papaya" 72msgstr "Papaya" 73EOF 74 75: ${DIFF=diff} 76${DIFF} mm-test26.ok mm-test26.out || Exit 1 77 78# Test with a PO file that has no translated messages. 79 80cat <<\EOF > mm-test26a.in1 81msgid "" 82msgstr "" 83"Content-Type: text/plain; charset=UTF-8\n" 84 85msgid "Hello world" 86msgstr "Hallo Welt" 87EOF 88 89cat <<\EOF > mm-test26a.in2 90msgid "" 91msgstr "" 92"Content-Type: text/plain; charset=ASCII\n" 93 94msgid "Hello, world!" 95msgstr "" 96EOF 97 98: ${MSGMERGE=msgmerge} 99${MSGMERGE} --for-msgfmt -o mm-test26a.tmp mm-test26a.in1 mm-test26a.in2 \ 100 || Exit 1 101LC_ALL=C tr -d '\r' < mm-test26a.tmp > mm-test26a.out || Exit 1 102 103cat <<\EOF > mm-test26a.ok 104msgid "" 105msgstr "Content-Type: text/plain; charset=UTF-8\n" 106EOF 107 108: ${DIFF=diff} 109${DIFF} mm-test26a.ok mm-test26a.out || Exit 1 110