No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / msgfmt-properties-1
bloba3cebb93aa0932d6a7a7ec23e2cbd4528814e3dc
1 #! /bin/sh
3 # Test basic functioning with Java .properties syntax.
5 tmpfiles=""
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
17 EOF
19 cat <<\EOF > mf-p-1-2.properties
20 # ---
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
25 EOF
27 # Without use of msgcat, expect a "duplicate message definition" error.
28 : ${MSGFMT=msgfmt}
29 if ${MSGFMT} --properties-input mf-p-1-1.properties mf-p-1-2.properties -o LC_MESSAGES/gen.mo 2> /dev/null; then
30 rm -fr $tmpfiles
31 exit 1
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"
43 : ${GETTEXT=gettext}
44 TEXTDOMAINDIR=.. LANGUAGE=tests \
45 ${GETTEXT} --env LC_ALL=en gen 'SYS_(C)
46 ' > mf-test1.out
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>
53 EOF
55 : ${DIFF=diff}
56 ${DIFF} gtmf-test1.ok mf-test1.out
57 result=$?
59 rm -fr $tmpfiles
61 exit $result