~win-cross-dev/win-cross/gettext

« back to all changes in this revision

Viewing changes to gettext-tools/tests/msgfmt-5

  • Committer: Nathan Osman
  • Date: 2012-08-11 05:06:52 UTC
  • Revision ID: admin@quickmediasolutions.com-20120811050652-ochkxjtonbw6kkve
Initial commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
 
 
3
# Test multi-domain handling.
 
4
 
 
5
tmpfiles=""
 
6
trap 'rm -fr $tmpfiles' 1 2 3 15
 
7
 
 
8
tmpfiles="$tmpfiles foo.po"
 
9
cat <<\EOF > foo.po
 
10
domain "foo-de"
 
11
msgid ""
 
12
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
 
13
 
 
14
# Das ist ein Kommentar.
 
15
msgid "hello"
 
16
msgstr "Hallo"
 
17
 
 
18
# Noch einer.
 
19
msgid "bye"
 
20
msgstr "Tsch��"
 
21
 
 
22
domain "foo-fr"
 
23
msgid ""
 
24
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
 
25
 
 
26
# Ceci est un commentaire.
 
27
msgid "hello"
 
28
msgstr "Salut"
 
29
 
 
30
# Encore un.
 
31
msgid "bye"
 
32
msgstr "A bient�t"
 
33
EOF
 
34
 
 
35
tmpfiles="$tmpfiles foo-de.mo foo-fr.mo"
 
36
: ${MSGFMT=msgfmt}
 
37
${MSGFMT} foo.po
 
38
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
 
39
 
 
40
tmpfiles="$tmpfiles foo-de.tmp foo-de.out foo-fr.tmp foo-fr.out"
 
41
: ${MSGUNFMT=msgunfmt}
 
42
${MSGUNFMT} -o foo-de.tmp foo-de.mo
 
43
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
 
44
LC_ALL=C tr -d '\r' < foo-de.tmp > foo-de.out
 
45
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
 
46
${MSGUNFMT} -o foo-fr.tmp foo-fr.mo
 
47
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
 
48
LC_ALL=C tr -d '\r' < foo-fr.tmp > foo-fr.out
 
49
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
 
50
 
 
51
tmpfiles="$tmpfiles foo-de.ok"
 
52
cat <<\EOF > foo-de.ok
 
53
msgid ""
 
54
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
 
55
 
 
56
msgid "bye"
 
57
msgstr "Tsch��"
 
58
 
 
59
msgid "hello"
 
60
msgstr "Hallo"
 
61
EOF
 
62
 
 
63
tmpfiles="$tmpfiles foo-fr.ok"
 
64
cat <<\EOF > foo-fr.ok
 
65
msgid ""
 
66
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
 
67
 
 
68
msgid "bye"
 
69
msgstr "A bient�t"
 
70
 
 
71
msgid "hello"
 
72
msgstr "Salut"
 
73
EOF
 
74
 
 
75
: ${DIFF=diff}
 
76
${DIFF} foo-de.ok foo-de.out && ${DIFF} foo-fr.ok foo-fr.out
 
77
result=$?
 
78
 
 
79
rm -fr $tmpfiles
 
80
 
 
81
exit $result