~ubuntu-branches/ubuntu/trusty/gettext/trusty

« back to all changes in this revision

Viewing changes to tests/msgfmt-1

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2002-04-10 13:17:42 UTC
  • Revision ID: james.westby@ubuntu.com-20020410131742-npf89tsaygdolprj
Tags: upstream-0.10.40
ImportĀ upstreamĀ versionĀ 0.10.40

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
 
 
3
TEXTDOMAINDIR=..
 
4
LANGUAGE=tests
 
5
LC_ALL=en
 
6
LC_MESSAGES=
 
7
LANG=
 
8
export TEXTDOMAINDIR LANGUAGE LC_ALL LC_MESSAGES LANG
 
9
 
 
10
tmpfiles="LC_MESSAGES"
 
11
test -d LC_MESSAGES || mkdir LC_MESSAGES
 
12
 
 
13
tmpfiles="$tmpfiles module1.po module2.po"
 
14
cat <<EOF > module1.po
 
15
#default domain "messages.mo"
 
16
msgid   "SYS_(C)\n"
 
17
msgstr "MSGFMT(3) portable message object file compiler\n"
 
18
"Copyright (C) 1995 Free Software Foundation\n"
 
19
"Report bugs to <bug-gnu-utils@gnu.org>\n"
 
20
msgid   "msg 1"
 
21
msgstr  "msg 1 translation"
 
22
#
 
23
domain  "help_dom"
 
24
msgid   "help 2 %d"
 
25
msgstr  "help 2 translation"
 
26
#
 
27
domain  "error_dom"
 
28
msgid   "error 3"
 
29
msgstr  "error 3 translation"
 
30
EOF
 
31
 
 
32
cat <<EOF > module2.po
 
33
# ---
 
34
#default domain "messages.mo"
 
35
msgid   "mesg 4"
 
36
msgstr  "mesg 4 translation"
 
37
#
 
38
domain  "error_dom"
 
39
msgid   "error 3"
 
40
msgstr  "alternate error 2 translation"
 
41
msgid   "error 5"
 
42
msgstr  "error 5 translation"
 
43
#
 
44
domain  "window_dom"
 
45
msgid   "window 6"
 
46
msgstr  "window 6 translation"
 
47
EOF
 
48
 
 
49
: ${MSGFMT=msgfmt}
 
50
${MSGFMT} module1.po module2.po -o LC_MESSAGES/gen.mo
 
51
 
 
52
tmpfiles="$tmpfiles mf-test1.out"
 
53
: ${GETTEXT=gettext}
 
54
${GETTEXT} gen 'SYS_(C)
 
55
' > mf-test1.out
 
56
 
 
57
tmpfiles="$tmpfiles gtmf-test1.ok"
 
58
cat <<EOF > gtmf-test1.ok
 
59
MSGFMT(3) portable message object file compiler
 
60
Copyright (C) 1995 Free Software Foundation
 
61
Report bugs to <bug-gnu-utils@gnu.org>
 
62
EOF
 
63
 
 
64
: ${DIFF=diff}
 
65
${DIFF} gtmf-test1.ok mf-test1.out
 
66
result=$?
 
67
 
 
68
rm -fr $tmpfiles
 
69
 
 
70
exit $result