[pmwiki-users] translation table using a variable

lists at basel-inside.ch lists at basel-inside.ch
Fri Jun 27 03:44:34 CDT 2014


Hello

I didn't find out until the moment, whether it's logic oder a bug  
$[lang_bas_str] doesn't seem to accept a function or ariable.

I ase a workarround now - I use a comparison and a litteral/constant  
to translate.

(:if equal {(substr {*$Trail} 9 7)} Gross:)[[Category/{(substr  
{*$Trail} 9 7)}?action=browse|$[Category]:$[Gross]-]](;elseif.....

it looks comlicated, and the tricky thing was also to not break the  
table with || (it would probably be better to use the (:cell:) markup.

but this template works correctly:

whole template:
[#prnxontrail]]
(:template each:)
(:if3 equal {*$FullName} {=$FullName}:)
||table border=1 align=left width=460
||  
[[{<$FullName}?Trail={*$Trail}|%fl1%<%%]][[{<$FullName}?Trail={*$Trail}|$[back]]] || (:if equal {(substr {*$Trail} 9 7)} Gross:)[[Category/{(substr {*$Trail} 9 7)}?action=browse|$[Category]:$[Gross]-]](:elseif equal {(substr {*$Trail} 9 7)} Medium:)[[Category/{(substr {*$Trail} 9 7)}?action=browse|$[Category]:$[Medium]-]](:elseif equal {(substr {*$Trail} 9 7)} Small:)[[Category/{(substr {*$Trail} 9 7)}?action=browse|$[Category]:$[Small]-]](:elseif equal {(substr {*$Trail} 9 7)} Special:)[[Category/{(substr {*$Trail} 9 7)}?action=browse|$[Category]:$[Special]-]](:ifend:)(:if2  ! equal "{*$Trail} "  " ":)[[{>$FullName}?Trail={*$Trail}|$[next]]][[{>$FullName}?Trail={*$Trail}|%fl1%>%%]](:if2end:)  
||
[[<<]]
(:if3end:)
[[#prnxontrailend]]
(:templateend:)


thanks for your hints
Patrick Ogay


Zitat von lists at basel-inside.ch:

> Hello,
>
> I updated to the latest pmwiki in the hope it may work, as I already  
> posted about this issue:
>
> $[Small] Category: $[{(substr {*$Trail} 9 7)}]  [1]
>                                 ^
>                                 |--  Small
>  Klein                           Small
>
> Is there a way to archive a translation from a substring?
>
> regards
> Patrick Ogay
>
>
> [1]
> macro:  (but think doesn't work in content either)
> [[#prnxontrail]]
> (:template each:)
> (:if equal {*$FullName} {=$FullName}:)
> ||table border=0 align=left width=500
> ||[[{<$FullName}?Trail={*$Trail}|<]][[{<$FullName}?Trail={*$Trail}|$[back]]]  
> || $[Small] Category: $[{(substr {*$Trail} 9 7)}]   ||  
> (:if2  ! equal "{*$Trail} "  "  
> ":)[[{>$FullName}?Trail={*$Trail}|$[next]]][[{>$FullName}?Trail={*$Trail}|>]](:if2end:)||
> [[<<]]
> (:ifend:)
> [[#prnxontrailend]]
> (:templateend:)
>
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>






More information about the pmwiki-users mailing list