<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 27, 2014 at 10:44 AM,  <span dir="ltr"><<a href="mailto:lists@basel-inside.ch" target="_blank">lists@basel-inside.ch</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div id=":c2" class="" style="overflow:hidden">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.<br>


<br>
I ase a workarround now - I use a comparison and a litteral/constant to translate.<br>
<br>
(:if equal {(substr {*$Trail} 9 7)} Gross:)[[Category/{(substr {*$Trail} 9 7)}?action=browse|$[Category]:<u></u>$[Gross]-]](;elseif.....</div></blockquote></div><br><br></div><div class="gmail_extra">If you set $EnableDiag to true and access a page with ?action=ruleset you will see that the $[phrase] rule for translation fires in order #7 while variables are order #8 and markup expressions are order #9.  This is why you cannot translate the results of variables or markup expressions.<br>

<br></div><div class="gmail_extra">At different times in the past when faced with a specific need like this where the standard rule order just doesn't do what I need I have copy/pasted the markup function call from stdmarkup.php into config.php and changed the name of the rule and the order.  Currently translation is accomplished like this:<br>

<br></div><div class="gmail_extra">===(snip)===<br># $[phrase] substitutions<br>Markup_e('$[phrase]', '>[=',<br>  '/\\$\\[(?>([^\\]]+))\\]/', "NoCache(XL(\$m[1]))");<br>===(snip)===<br>

<br></div><div class="gmail_extra">I would copy that from scripts/stdmarkup.php into config.php and change it to be something like this:<br><br></div><div class="gmail_extra">===(snip)===<br># $[phrase] substitutions<br>
Markup_e('$[latexlate]', '>{(',<br>
  '/\\$\\[(?>([^\\]]+))\\]/', "NoCache(XL(\$m[1]))");<br>===(snip)===<br><br></div><div class="gmail_extra">That will run right after markup expressions.  (Sometimes changing the order of one rule like this will swap around the order of other rules if the new order still fulfills the specified requirements, so you'll want to ensure that it's still happening after {$var} as well using the ?action=ruleset again.)<br>

</div><div class="gmail_extra"><br></div><div class="gmail_extra">It's somewhat inefficient because you will run the same rule twice, but it keeps you from making changes to the core and it solves the problem you're dealing with...<br>

<br></div><div class="gmail_extra">Oh, this assumes that the variable or the markup expression actually contains the $[ and ] characters as well.  If you are doing $[{$var}] then you'll need to change the markup slightly to be $late[{$var}] and then change the regular expression to match appropriately.  (Otherwise the $[...] will be changed to just ... by the firing of the first rule.)<br>

<br></div><div class="gmail_extra">I believe there's some way to delete a rule and then just redefine it in your config.php - in fact, maybe simply by re-defining it you get rid of previous definitions? - but it's been too long since I played with this stuff so I don't remember.  If you can re-define the rule then just copy/paste from stdmarkup.php and change the 2nd argument to be in the order you want it to be.<br>

</div><div class="gmail_extra"><br></div><div class="gmail_extra">-Peter<br></div></div>