3 # Test of position dependent recognition of format strings.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles
="$tmpfiles xg-test6.c"
9 cat <<\EOF
> xg-test6.c
10 fprintf
(fp
, gettext ("c-format positive1"), gettext ("c-format negative1"));
11 printk
(gettext ("c-format negative2"));
14 tmpfiles
="$tmpfiles xg-test6.sh"
15 cat <<\EOF
> xg-test6.sh
16 eval_gettext
"sh-format positive1" "`gettext \"sh-format negative1\"`"
17 echo "`gettext \"sh-format negative2\"`"
20 tmpfiles
="$tmpfiles xg-test6.py"
21 cat <<\EOF
> xg-test6.py
22 my_printf
(gettext ("python-format positive1"),
23 gettext ("python-format negative1"));
24 printk
(gettext ("python-format negative2"));
27 tmpfiles
="$tmpfiles xg-test6.lisp"
28 cat <<\EOF
> xg-test6.lisp
29 (format t
(gettext "lisp-format positive1") (gettext "lisp-format negative1"))
30 (prin1
(gettext "lisp-format negative2"))
33 tmpfiles
="$tmpfiles xg-test6.el"
34 cat <<\EOF
> xg-test6.el
35 (format
(_
"elisp-format positive1") (_
"elisp-format negative1"))
36 (printk
(_
"elisp-format negative2"))
39 tmpfiles
="$tmpfiles xg-test6.jl"
40 cat <<\EOF
> xg-test6.jl
41 (format stream
(_
"librep-format positive1") (_
"librep-format negative1"))
42 (printk
(_
"librep-format negative2"))
45 tmpfiles
="$tmpfiles xg-test6.java"
46 cat <<\EOF
> xg-test6.java
47 MessageFormat.format
(gettext("java-format positive1"),
48 gettext("java-format negative1"));
49 System.err.println
(gettext("java-format negative2"));
52 tmpfiles
="$tmpfiles xg-test6.awk"
53 cat <<\EOF
> xg-test6.
awk
54 printf dcgettext
("awk-format positive1"), dcgettext
("awk-format negative1");
55 printf (dcgettext
("awk-format positive2"), dcgettext
("awk-format negative2"));
56 printf dcgettext
("awk-format positive3"); dcgettext
("awk-format negative3");
57 printk dcgettext
("awk-format negative4");
60 tmpfiles
="$tmpfiles xg-test6.ycp"
61 cat <<\EOF
> xg-test6.ycp
62 sformat
(_
("ycp-format positive1"), _
("ycp-format negative1"));
63 printk
(_
("ycp-format negative2"));
66 tmpfiles
="$tmpfiles xg-test6.tcl"
67 cat <<\EOF
> xg-test6.tcl
68 [format
[::msgcat
::mc
"tcl-format positive1"]
69 [::msgcat
::mc
"tcl-format negative1"]]
70 [print
[::msgcat
::mc
"tcl-format negative2"]]
73 tmpfiles
="$tmpfiles xg-test6.pl"
74 cat <<\EOF
> xg-test6.pl
75 printf gettext "perl-format positive1", gettext ("perl-format negative1");
76 gettext ("perl-format negative2");
77 printf gettext "perl-format positive2"; gettext ("perl-format negative3");
78 gettext ("perl-format negative4");
79 print sprintf
gettext "perl-format positive3";
80 print kprintf
gettext "perl-format negative5";
83 tmpfiles
="$tmpfiles xg-test6.php"
84 cat <<\EOF
> xg-test6.php
86 printf (_
("php-format positive1"), _
("php-format negative1"));
87 printk
(_
("php-format negative2"));
90 tmpfiles
="$tmpfiles xg-test6.po"
91 : ${XGETTEXT=xgettext}
92 ${XGETTEXT} --omit-header --no-location -d xg-test6 \
93 --flag=my_printf
:1:python-format \
94 xg-test6.c xg-test6.sh xg-test6.py xg-test6.lisp xg-test6.el \
95 xg-test6.jl xg-test6.java xg-test6.
awk xg-test6.ycp xg-test6.tcl \
96 xg-test6.pl xg-test6.php
97 test $?
= 0 ||
{ rm -fr $tmpfiles; exit 1; }
99 tmpfiles
="$tmpfiles xg-test6.ok"
100 cat <<\EOF
> xg-test6.ok
102 msgid
"c-format positive1"
105 msgid
"c-format negative1"
108 msgid
"c-format negative2"
112 msgid
"sh-format positive1"
115 msgid
"sh-format negative1"
118 msgid
"sh-format negative2"
122 msgid
"python-format positive1"
125 msgid
"python-format negative1"
128 msgid
"python-format negative2"
132 msgid
"lisp-format positive1"
135 msgid
"lisp-format negative1"
138 msgid
"lisp-format negative2"
142 msgid
"elisp-format positive1"
145 msgid
"elisp-format negative1"
148 msgid
"elisp-format negative2"
152 msgid
"librep-format positive1"
155 msgid
"librep-format negative1"
158 msgid
"librep-format negative2"
162 msgid
"java-format positive1"
165 msgid
"java-format negative1"
168 msgid
"java-format negative2"
172 msgid
"awk-format positive1"
175 msgid
"awk-format negative1"
179 msgid
"awk-format positive2"
182 msgid
"awk-format negative2"
186 msgid
"awk-format positive3"
189 msgid
"awk-format negative3"
192 msgid
"awk-format negative4"
196 msgid
"ycp-format positive1"
199 msgid
"ycp-format negative1"
202 msgid
"ycp-format negative2"
206 msgid
"tcl-format positive1"
209 msgid
"tcl-format negative1"
212 msgid
"tcl-format negative2"
216 msgid
"perl-format positive1"
219 msgid
"perl-format negative1"
222 msgid
"perl-format negative2"
226 msgid
"perl-format positive2"
229 msgid
"perl-format negative3"
232 msgid
"perl-format negative4"
236 msgid
"perl-format positive3"
239 msgid
"perl-format negative5"
243 msgid
"php-format positive1"
246 msgid
"php-format negative1"
249 msgid
"php-format negative2"
254 ${DIFF} xg-test6.ok xg-test6.po