• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/ap/gpl/timemachine/gettext-0.17/gettext-tools/tests/
1#! /bin/sh
2
3# Test reading in NeXTstep/GNUstep .strings syntax.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles mcat-s-1.in"
9cat <<\EOF > mcat-s-1.in
10/* This is an example of a string table file. Everything inside a comment
11is completely ignored, even if in "quotes", or \escape characters, etc.
12*/
13
14"title"	= "pattern II target 1";
15
16/* This is an example of excape codes in the string table, codes */
17/* that are not one of abfnrtv are stripped of the \ character */
18"escapes"    = "This is a tab \t and a return \n or a \a but not a \p";
19"escapes2"    = "Well how about a \0? Guess not.";
20
21/* more parameters, white space between tokens is ignored */
22"actualSize"	
23	= 
24		"0.000250 0.000250";
25
26/* a key with no value assumes the value is the empty string */
27"hoe322070.element";
28EOF
29
30tmpfiles="$tmpfiles mcat-s-1.tmp mcat-s-1.err mcat-s-1.out"
31rm -f mcat-s-1.tmp
32: ${MSGCAT=msgcat}
33LC_MESSAGES=C LC_ALL= \
34${MSGCAT} --stringtable-input -o mcat-s-1.tmp mcat-s-1.in >mcat-s-1.err 2>&1
35result=$?
36cat mcat-s-1.err | grep -v ': internationalized messages'
37test $result = 0 || { rm -fr $tmpfiles; exit 1; }
38tr -d '\r' < mcat-s-1.tmp > mcat-s-1.out
39test $? = 0 || { rm -fr $tmpfiles; exit 1; }
40
41tmpfiles="$tmpfiles mcat-s-1.ok"
42cat << \EOF > mcat-s-1.ok
43# This is an example of a string table file. Everything inside a comment
44# is completely ignored, even if in "quotes", or \escape characters, etc.
45#
46msgid "title"
47msgstr "pattern II target 1"
48
49# This is an example of excape codes in the string table, codes
50# that are not one of abfnrtv are stripped of the \ character
51msgid "escapes"
52msgstr ""
53"This is a tab \t and a return \n"
54" or a \a but not a p"
55
56msgid "escapes2"
57msgstr "Well how about a "
58
59# more parameters, white space between tokens is ignored
60msgid "actualSize"
61msgstr "0.000250 0.000250"
62
63# a key with no value assumes the value is the empty string
64msgid "hoe322070.element"
65msgstr ""
66EOF
67
68: ${DIFF=diff}
69${DIFF} mcat-s-1.ok mcat-s-1.out
70result=$?
71
72rm -fr $tmpfiles
73
74exit $result
75