~ubuntu-branches/ubuntu/breezy/gettext/breezy

« back to all changes in this revision

Viewing changes to gettext-tools/tests/msgfmt-properties-1

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2004-03-14 17:40:02 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040314174002-p1ad5ldve1hqzhye
Tags: 0.14.1-2
* Added libexpat1-dev to Build-Depends, for glade support.
* Added libc0.1-dev to Build-Depends, for GNU/kFreeBSD.
* Removed special-casing of knetbsd-gnu in debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
 
 
3
# Test basic functioning with Java .properties syntax.
 
4
 
 
5
tmpfiles=""
 
6
trap 'rm -fr $tmpfiles' 1 2 3 15
 
7
 
 
8
tmpfiles="$tmpfiles LC_MESSAGES"
 
9
test -d LC_MESSAGES || mkdir LC_MESSAGES
 
10
 
 
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
 
18
 
 
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
 
26
 
 
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
 
32
fi
 
33
 
 
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; }
 
41
 
 
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
 
47
 
 
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
 
54
 
 
55
: ${DIFF=diff}
 
56
${DIFF} gtmf-test1.ok mf-test1.out
 
57
result=$?
 
58
 
 
59
rm -fr $tmpfiles
 
60
 
 
61
exit $result