3 # Test basic functionality, duplicate detection, multiple domains.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles
="$tmpfiles LC_MESSAGES"
9 test -d LC_MESSAGES || mkdir LC_MESSAGES
11 tmpfiles
="$tmpfiles module1.po module2.po"
12 cat <<EOF > module1.po
13 #default domain "messages.mo"
15 msgstr "MSGFMT(3) portable message object file compiler\n"
16 "Copyright (C) 1995 Free Software Foundation\n"
17 "Report bugs to <bug-gnu-utils@gnu.org>\n"
19 msgstr "msg 1 translation"
23 msgstr "help 2 translation"
27 msgstr "error 3 translation"
30 cat <<EOF > module2.po
32 #default domain "messages.mo"
34 msgstr "mesg 4 translation"
38 msgstr "alternate error 3 translation"
40 msgstr "error 5 translation"
44 msgstr "window 6 translation"
47 # Without use of msgcat, expect a "duplicate message definition" error.
49 if ${MSGFMT} module1.po module2.po
-o LC_MESSAGES
/gen.mo
2> /dev
/null
; then
54 # With msgcat, it should work.
55 tmpfiles
="$tmpfiles modules.po"
56 : ${MSGCAT=msgcat} ${MSGFMT=msgfmt}
57 ${MSGCAT} --use-first module1.po module2.po
-o modules.po
58 test $?
= 0 ||
{ rm -fr $tmpfiles; exit 1; }
59 ${MSGFMT} modules.po
-o LC_MESSAGES
/gen.mo
60 test $?
= 0 ||
{ rm -fr $tmpfiles; exit 1; }
62 tmpfiles
="$tmpfiles mf-test1.out"
64 TEXTDOMAINDIR
=.. LANGUAGE
=tests \
65 ${GETTEXT} --env LC_ALL
=en gen
'SYS_(C)
68 tmpfiles
="$tmpfiles gtmf-test1.ok"
69 cat <<EOF > gtmf-test1.ok
70 MSGFMT(3) portable message object file compiler
71 Copyright (C) 1995 Free Software Foundation
72 Report bugs to <bug-gnu-utils@gnu.org>
76 ${DIFF} gtmf-test1.ok mf-test1.out