Page 1 of 1

Translations and .TPL

Posted: 28 October 2020, 19:19
by tsaunat
Is there a way to do translations in the TPL? I have some text that's just the player action info, and I have it placed in the .tpl file, but it obviously doesn't translate. It feels awkward to move it to either the PHP or the JS, but if that's the way it is, sometimes that's just the way it is.

Re: Translations and .TPL

Posted: 28 October 2020, 19:32
by XCID
You have to translate it in the .view.php file and using a placeholder.

<div class="info">{INFOTEXT}</div>

$this->tpl['INFOTEXT'] = self::_("My text...");