3
# Test basic functioning with Java .properties syntax.
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 mf-p-1-1.properties mf-p-1-2.properties"
12
cat <<\EOF > mf-p-1-1.properties
13
SYS_(C)\n=MSGFMT(3) portable message object file compiler\nCopyright (C) 1995 Free Software Foundation\nReport bugs to <bug-gnu-utils@gnu.org>\n
14
msg\ 1=msg 1 translation
15
help\ 2\ %d=help 2 translation
16
error\ 3=error 3 translation
19
cat <<\EOF > mf-p-1-2.properties
21
mesg\ 4=mesg 4 translation
22
error\ 3=alternate error 3 translation
23
error\ 5=error 5 translation
24
window\ 6=window 6 translation
27
# Without use of msgcat, expect a "duplicate message definition" error.
29
if ${MSGFMT} --properties-input mf-p-1-1.properties mf-p-1-2.properties -o LC_MESSAGES/gen.mo 2> /dev/null; then
34
# With msgcat, it should work.
35
tmpfiles="$tmpfiles mf-p-1-s.properties"
36
: ${MSGCAT=msgcat} ${MSGFMT=msgfmt}
37
${MSGCAT} --properties-input --properties-output --use-first mf-p-1-1.properties mf-p-1-2.properties -o mf-p-1-s.properties
38
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
39
${MSGFMT} --properties-input mf-p-1-s.properties -o LC_MESSAGES/gen.mo
40
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
42
tmpfiles="$tmpfiles mf-test1.out"
44
TEXTDOMAINDIR=.. LANGUAGE=tests \
45
${GETTEXT} --env LC_ALL=en gen 'SYS_(C)
48
tmpfiles="$tmpfiles gtmf-test1.ok"
49
cat <<EOF > gtmf-test1.ok
50
MSGFMT(3) portable message object file compiler
51
Copyright (C) 1995 Free Software Foundation
52
Report bugs to <bug-gnu-utils@gnu.org>
56
${DIFF} gtmf-test1.ok mf-test1.out