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

Re: Nested slices and variables



Ghislaine Labouret wrote:

> When nesting languages slices into another one like this :
> 
> <en: <fr: français><en: english>>
> 
> the output is, as I expected :
> - nothing in the .fr file
> - "english" in the .en file
> 
> But, if the inside slices come from a variable, like this :
> 
> <set-var foo="<fr: français><en: english>">
> <en: <get-var foo>>
> 
> the output becomes this :
> - "français" in the .fr file
> - "françaisenglish" in the .en file
> 
> Is this a feature or a bug?
> 
> 
> Sincerely,


Hello,

you'll have an answer with pass 2 output :

   bash-2.05a$ wml -p1-2 test.wml

   (see attachments)


and with slice man page, section "Advanced Selection: Slice Levels", you 
may see that your test.wml produces:

Level
|
v

2          [LANG_EN:english:LANG_EN]
1 [LANG_EN:                         :LANG_EN]
0

after "Without variable:"


and

2          [LANG_FR:français:LANG_FR][LANG_EN:english:LANG_EN]
1 [LANG_EN:                                                   :LANG_EN]
0
after "With variable:"

etc.


During pass 9 (slice) since the word "français" is include
in level 1 LANG_EN it appears in output. QED



I think it will be a good idea to have languages slices in the same 
level ;-)


Cordially,

Jean-Michel

<fr:
PS:
il y a plusieurs façons intéressantes de traiter facilement les grandes 
quantités de textes multilingues avec wml, comme cela dépasse la réponse 
à ce mail tu peux me demander directement...
 >




 

<:# line 0 "/tmp/ipp.11677.tmp":>
<:# line 0 "test.wml":>
<:# line 0 "/usr/lib/wml/include/std/lang.wml":>
<:# line 0 "/usr/lib/wml/include/mod/version.wml":>
<:# line 8 "/usr/lib/wml/include/std/lang.wml":>
  
  
<:# line 0 "/usr/lib/wml/include/std/tags.wml":>
<:# line 7 "/usr/lib/wml/include/std/tags.wml":>
  
  
<:# line 11 "/usr/lib/wml/include/std/lang.wml":>
<:# line 1 "test.wml":>
%!slice -o LANG_FRuUNDEF:test.html.fr -o LANG_ENuUNDEF:test.html.en
Without variable: [LANG_EN:[LANG_EN:english:LANG_EN]:LANG_EN]
With variable: [LANG_EN:[LANG_FR:français:LANG_FR][LANG_EN:english:LANG_EN]:LANG_EN]
Workarounds:
With language-dependant variables: [LANG_EN:english:LANG_EN]
With tag: [LANG_EN:[LANG_EN:english:LANG_EN]:LANG_EN]