[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: RfD: Multi-Lingual Support

Hello Fritz Zaucker, in a previous mail you wrote:

> > Thats the point why I really tried to avoid programming it with
> > ePerl (Pass 3) because a lot of tags are programmed this way and
> > nesting then is not possible.
> Is this a principal problem? I think it is a big handicap, as one has
> to KNOW which tag is programmed in what ...

Yes, it is. Read point three of Q03 in wml_faq(7) ;_)

Thats the drawback of a pragmatical pass-oriented approach instead of an
integrated all-in-one processing scheme. The principle problem is that the
current ePerl implementation does not support nested Perl blocks. So, when one
writes an own tag and programmes it with Perl, this tag should be a final one
which usually is not nested inside another one which is also programmed in
Perl. Ok, there is a working trick which wml::std::grid uses for its <cell>
tag to allow any other tag inside it. The trick uses Pass 5 (Divert). But this
trick makes it even more complicated. I don't expect everyone to understand
the source of wml_include/std/grid.src...

> > These spaces are not "introduced" in Pass 9, but I know what effect
> > you mean: Because Pass 9 (Slice) only does what it is asked for, you
> > usually lost linefeeds when these are outside the slices. One really
> > has to make sure where to place the newlines. Can you give me your
> > example, so we can fix it together?
>   <A HREF="/~elekws/">\
>   <en>EE Machine Shop</en>\
>   <de>Elektrotechnik Werkstatt</de>\
>   <es>Tienda de maquinaria</es>\
>   <ca>Tenda de maquinària</ca>\
>   <fr>Atelier d'électrotechnique</fr>\
>   <ch>D'Elektrotechnik Werchschtatt</ch>\
>   <it>Atelier di elettrotecnica</it>\
>   </A>
> Without the backslashes I get additional blanks around the link.

Correct, the problem is that without the backslashes the above gets translated
to the following (assuming your ``[XX:%body:XX]'' definition of tag <xx>)
(I've written down the newlines for illustration):

   <A HREF="/~elekws/">\n
   [EN:EE Machine Shop:EN]\n
   [DE:Elektrotechnik Werkstatt:DE]\n
   [ES:Tienda de maquinaria:ES]\n
   [CA:Tenda de maquinària:CA]\n
   [FR:Atelier d'électrotechnique:FR]\n
   [CH:D'Elektrotechnik Werchschtatt:CH]\n
   [IT:Atelier di elettrotecnica:IT]\n

Now for instance when the sliceterm UNDEFuCH is used, Pass 9 (Slice) does what
you requested: It writes out anything outside Slice delimiters which is not
defined by explicit slice terms (UNDEF) plus all content inside the slices
named CH. The result is:

   <A HREF="/~elekws/">\n
   D'Elektrotechnik Werchschtatt\n

In others words: A lot of whitespaces as you discovered, because they are part
of the UNDEF slice. But this is not a bug, its a feature: Slice really does
only what you request it to do.  Your backslash solution is already the best
one here, although <suck> will work too. But it is longer then just a

Notice: Theoretically you could define your tags as
``<suck>[XX:%body:XX]<suck>''. This way the above example would expand to

   <A HREF="/~elekws/">D'Elektrotechnik Werchschtatt</A>\n

but the chance is to high that on other examples this sucks out to much
whitespaces which should remain. 

But now I think we really need some support in wml::std::lang also for such
cases of a language alternative list. Because such a thing occurs often.  I
will thing about this feature, too.

                                       Ralf S. Engelschall
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com