File: msgconv-2

package info (click to toggle)
gettext 0.18.1.1-9
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 70,628 kB
  • sloc: ansic: 333,297; sh: 51,604; makefile: 8,355; perl: 4,181; lisp: 3,357; yacc: 665; java: 613; cs: 578; sed: 369; objc: 337; cpp: 325; awk: 80; tcl: 63; pascal: 11; php: 8
file content (51 lines) | stat: -rwxr-xr-x 1,196 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#! /bin/sh

# Test conversion from UTF-8 to BIG5.
# Test that encoding names are case insensitive.

tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15

tmpfiles="$tmpfiles mco-test2.po"
cat <<\EOF > mco-test2.po
# Chinese translation for GNU gettext messages.
#
msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: src/msgcmp.c:155 src/msgmerge.c:273
msgid "exactly 2 input files required"
msgstr "此功能需要恰好指定兩個輸入檔"
EOF

tmpfiles="$tmpfiles mco-test2.out"
: ${MSGCONV=msgconv}
${MSGCONV} -t Big5 -o mco-test2.out mco-test2.po
test $? = 0 || { rm -fr $tmpfiles; exit 1; }

tmpfiles="$tmpfiles mco-test2.ok"
cat <<\EOF > mco-test2.ok
# Chinese translation for GNU gettext messages.
#
msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=BIG5\n"
"Content-Transfer-Encoding: 8bit\n"

#: src/msgcmp.c:155 src/msgmerge.c:273
msgid "exactly 2 input files required"
msgstr "\ݭnnwӿJ"
EOF

: ${DIFF=diff}
# Redirect stdout, so as not to fill the user's screen with non-ASCII bytes.
${DIFF} mco-test2.ok mco-test2.out >/dev/null
result=$?

rm -fr $tmpfiles

exit $result