2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test basic functionality, duplicate detection, multiple domains.
6 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
7 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
8 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
18 test -d mf-2 || mkdir mf-2
19 test -d mf-2/LC_MESSAGES || mkdir mf-2/LC_MESSAGES
21 cat <<EOF > mf-2-module1.po
22 #default domain "messages.mo"
24 msgstr "MSGFMT(3) portable message object file compiler\n"
25 "Copyright (C) 1995 Free Software Foundation\n"
26 "Report bugs to <bug-gnu-utils@gnu.org>\n"
28 msgstr "msg 1 translation"
32 msgstr "help 2 translation"
36 msgstr "error 3 translation"
39 cat <<EOF > mf-2-module2.po
41 #default domain "messages.mo"
43 msgstr "mesg 4 translation"
47 msgstr "alternate error 3 translation"
49 msgstr "error 5 translation"
53 msgstr "window 6 translation"
56 # Without use of msgcat, expect a "duplicate message definition" error.
58 if ${MSGFMT} -o mf-2/LC_MESSAGES/gen.mo mf-2-module1.po mf-2-module2.po 2> /dev/null; then
62 # With msgcat, it should work.
63 : ${MSGCAT=msgcat} ${MSGFMT=msgfmt}
64 ${MSGCAT} --use-first -o mf-2-modules.po mf-2-module1.po mf-2-module2.po || exit 1
65 ${MSGFMT} -o mf-2/LC_MESSAGES/gen.mo mf-2-modules.po || exit 1
68 TEXTDOMAINDIR=. LANGUAGE=mf-2 \
69 ${GETTEXT} --env LC_ALL=en gen 'error 3' > mf-test2.out
71 echo $ac_n "error 3 translation$ac_c" > gtmf-test2.ok
74 ${DIFF} gtmf-test2.ok mf-test2.out