2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test of position dependent recognition of format strings.
6 cat <<\EOF > xg-test6.c
7 fprintf (fp, gettext ("c-format positive1"), gettext ("c-format negative1"));
8 printk (gettext ("c-format negative2"));
11 cat <<\EOF > xg-test6.sh
12 eval_gettext "sh-format positive1" "`gettext \"sh-format negative1\"`"
13 echo "`gettext \"sh-format negative2\"`"
16 cat <<\EOF > xg-test6.py
17 my_printf (gettext ("python-format positive1"),
18 gettext ("python-format negative1"));
19 printk (gettext ("python-format negative2"));
22 cat <<\EOF > xg-test6.lisp
23 (format t (gettext "lisp-format positive1") (gettext "lisp-format negative1"))
24 (prin1 (gettext "lisp-format negative2"))
27 cat <<\EOF > xg-test6.el
28 (format (_ "elisp-format positive1") (_ "elisp-format negative1"))
29 (printk (_ "elisp-format negative2"))
32 cat <<\EOF > xg-test6.jl
33 (format stream (_ "librep-format positive1") (_ "librep-format negative1"))
34 (printk (_ "librep-format negative2"))
37 cat <<\EOF > xg-test6.java
38 MessageFormat.format(gettext("java-format positive1"),
39 gettext("java-format negative1"));
40 System.err.println(gettext("java-format negative2"));
43 cat <<\EOF > xg-test6.awk
44 printf dcgettext ("awk-format positive1"), dcgettext ("awk-format negative1");
45 printf (dcgettext ("awk-format positive2"), dcgettext ("awk-format negative2"));
46 printf dcgettext ("awk-format positive3"); dcgettext ("awk-format negative3");
47 printk dcgettext ("awk-format negative4");
50 cat <<\EOF > xg-test6.ycp
51 sformat (_("ycp-format positive1"), _("ycp-format negative1"));
52 printk (_("ycp-format negative2"));
55 cat <<\EOF > xg-test6.tcl
56 [format [::msgcat::mc "tcl-format positive1"]
57 [::msgcat::mc "tcl-format negative1"]]
58 [print [::msgcat::mc "tcl-format negative2"]]
61 cat <<\EOF > xg-test6.pl
62 printf gettext "perl-format positive1", gettext ("perl-format negative1");
63 gettext ("perl-format negative2");
64 printf gettext "perl-format positive2"; gettext ("perl-format negative3");
65 gettext ("perl-format negative4");
66 print sprintf gettext "perl-format positive3";
67 print kprintf gettext "perl-format negative5";
70 cat <<\EOF > xg-test6.php
72 printf (_ ("php-format positive1"), _ ("php-format negative1"));
73 printk (_ ("php-format negative2"));
76 : ${XGETTEXT=xgettext}
77 ${XGETTEXT} --omit-header --no-location -d xg-test6.tmp \
78 --flag=my_printf:1:python-format \
79 xg-test6.c xg-test6.sh xg-test6.py xg-test6.lisp xg-test6.el \
80 xg-test6.jl xg-test6.java xg-test6.awk xg-test6.ycp xg-test6.tcl \
81 xg-test6.pl xg-test6.php || exit 1
82 LC_ALL=C tr -d '\r' < xg-test6.tmp.po > xg-test6.po || exit 1
84 cat <<\EOF > xg-test6.ok
86 msgid "c-format positive1"
89 msgid "c-format negative1"
92 msgid "c-format negative2"
96 msgid "sh-format positive1"
99 msgid "sh-format negative1"
102 msgid "sh-format negative2"
106 msgid "python-format positive1"
109 msgid "python-format negative1"
112 msgid "python-format negative2"
116 msgid "lisp-format positive1"
119 msgid "lisp-format negative1"
122 msgid "lisp-format negative2"
126 msgid "elisp-format positive1"
129 msgid "elisp-format negative1"
132 msgid "elisp-format negative2"
136 msgid "librep-format positive1"
139 msgid "librep-format negative1"
142 msgid "librep-format negative2"
146 msgid "java-format positive1"
149 msgid "java-format negative1"
152 msgid "java-format negative2"
156 msgid "awk-format positive1"
159 msgid "awk-format negative1"
163 msgid "awk-format positive2"
166 msgid "awk-format negative2"
170 msgid "awk-format positive3"
173 msgid "awk-format negative3"
176 msgid "awk-format negative4"
180 msgid "ycp-format positive1"
183 msgid "ycp-format negative1"
186 msgid "ycp-format negative2"
190 msgid "tcl-format positive1"
193 msgid "tcl-format negative1"
196 msgid "tcl-format negative2"
200 msgid "perl-format positive1"
203 msgid "perl-format negative1"
206 msgid "perl-format negative2"
210 msgid "perl-format positive2"
213 msgid "perl-format negative3"
216 msgid "perl-format negative4"
220 msgid "perl-format positive3"
223 msgid "perl-format negative5"
227 msgid "php-format positive1"
230 msgid "php-format negative1"
233 msgid "php-format negative2"
238 ${DIFF} xg-test6.ok xg-test6.po