Translations and .TPL

Game development with Board Game Arena Studio
Post Reply
User avatar
tsaunat
Posts: 30
Joined: 28 April 2020, 05:10

Translations and .TPL

Post 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.
User avatar
XCID
Posts: 78
Joined: 26 March 2020, 01:45

Re: Translations and .TPL

Post 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...");
Post Reply

Return to “Developers”