File: msgcat-stringtable-1

package info (click to toggle)
gettext 0.14.4-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 37,764 kB
  • ctags: 9,842
  • sloc: ansic: 87,836; sh: 41,602; makefile: 7,790; perl: 4,154; lisp: 2,899; cs: 548; yacc: 527; java: 506; sed: 357; objc: 337; cpp: 254; awk: 81; tcl: 63; pascal: 12; php: 8
file content (69 lines) | stat: -rwxr-xr-x 1,782 bytes parent folder | download
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#! /bin/sh

# Test reading in NeXTstep/GNUstep .strings syntax.

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

tmpfiles="$tmpfiles mcat-s-1.in"
cat <<\EOF > mcat-s-1.in
/* This is an example of a string table file. Everything inside a comment
is completely ignored, even if in "quotes", or \escape characters, etc.
*/

"title"	= "pattern II target 1";

/* This is an example of excape codes in the string table, codes */
/* that are not one of abfnrtv are stripped of the \ character */
"escapes"    = "This is a tab \t and a return \n or a \a but not a \p";
"escapes2"    = "Well how about a \0? Guess not.";

/* more parameters, white space between tokens is ignored */
"actualSize"	
	= 
		"0.000250 0.000250";

/* a key with no value assumes the value is the empty string */
"hoe322070.element";
EOF

tmpfiles="$tmpfiles mcat-s-1.out"
rm -f mcat-s-1.out
: ${MSGCAT=msgcat}
${MSGCAT} --stringtable-input mcat-s-1.in -o mcat-s-1.out
test $? = 0 || { rm -fr $tmpfiles; exit 1; }

tmpfiles="$tmpfiles mcat-s-1.ok"
cat << \EOF > mcat-s-1.ok
# This is an example of a string table file. Everything inside a comment
# is completely ignored, even if in "quotes", or \escape characters, etc.
#
msgid "title"
msgstr "pattern II target 1"

# This is an example of excape codes in the string table, codes
# that are not one of abfnrtv are stripped of the \ character
msgid "escapes"
msgstr ""
"This is a tab \t and a return \n"
" or a  but not a p"

msgid "escapes2"
msgstr "Well how about a "

# more parameters, white space between tokens is ignored
msgid "actualSize"
msgstr "0.000250 0.000250"

# a key with no value assumes the value is the empty string
msgid "hoe322070.element"
msgstr ""
EOF

: ${DIFF=diff}
${DIFF} mcat-s-1.ok mcat-s-1.out
result=$?

rm -fr $tmpfiles

exit $result