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