Re: Debian website and WML 2.x
On Fri, Jun 16, 2000 at 11:29:17AM +0200, Martin Quinson wrote:
> On Fri, 16 Jun 2000, Denis Barbier wrote:
[...]
> > * in scripts/i18n.pl, lines like
> > $str =~ s/<td/<td align=center BGCOLOR="#ddddd5"/g;
> > are replaced by
> > $str =~ s/<td>/<td align=center BGCOLOR="#ddddd5">/g;
>
> Why so ? it is in a perl part. Does the new wml try to find tags ? I don't
> really understand.
In scripts/i18n.pl you wrote
<PERL>
#include "../../english/international/l10n/scripts/init.pl"
$str = "<table border=1><tr><td><category><td colspan=2><I18N-ED><td
...
so you want wml to expand <category> and <I18N-ED> inside your perl
script.
> What will hapend if I use 'if ($x<2) {...}' ? will it
> see an unended <2> tag ?
No, because tag names cannot begin with a digit.
> Anyway, you can't apply your fix so easily. Look a biger snipet of the code :
> $str = "<tr><td><category><td colspan=2><I18N-ED><td
> colspan=2><Catalogs><br><I18N-prcent><td
> colspan=3><Organisation><br><I18N-prcent>\n";
> $str =~ s/<td/<td align=center BGCOLOR="#ddddd5"/g;
>
> If you make your modification, the <td colspan=2> won't have the good
> background. But it's not so hard to fix : instead of be lazy and ask a
> perl regexp to put the background, we could put it ourselves...
> But I used this trick in a lot of files in this directory. Is it the only
> file with which you have this problem ?
> l10n.pl(l21) : $header =~ s/<td/<td BGCOLOR="#ddddd5" align=center/g;
> also in l10n-rank.pl, and I sure, almost every one...
You're right, my fix did not output the same result. You may write instead
$str =~ s/<(td)/<$1 align=center BGCOLOR="#ddddd5"/g;
To fix all your files, try
for f in scripts/*.pl; do
sed -e 's/s\/<td\/<td/s\/<(td)\/<$1/g' $f > $f.tmp && mv $f.tmp $f
done
Denis
Reply to: