How to correctly handle functions in the translation files? (PHP templates)
<p>I've searched for this in the manual but I found nothing. 
I have for example this view:</p>

<pre><code>//view.html.php
&lt;?php $view-&gt;extend('::base.html.php') ?&gt;
&lt;?php $view['slots']-&gt;start('real-content') ?&gt;

&lt;?php echo $view['translator']-&gt;trans('user.name') ?&gt;

&lt;?php $view['slots']-&gt;stop('real-content') ?&gt;
</code></pre>

<p>How can I insert the function <code>getUsername()</code> in the translation file in order to be rendered correctly?
Is this the best way?</p>

<pre><code>//messages.en.php
'user.name' =&gt; 'Name: %user-&gt;getUsername()%'
</code></pre>