Translation of standalone latte application

Notice: This thread is very old.
Member | 57

Hi all, I have simple web with now mvc architecture, using only form, mail, latte and tracy from Nette framework. Can you help me with setup of translator? I cant figure it out.

I am going stright forward as documentation says. How to inject language and translation file?

$latte = new \Latte\Engine;
$template = new \Nette\Templating\FileTemplate;
$template->setTranslator(new MyTranslator);
$template->rezervace = $rezervace;
$template->emailTo = EMAIL_TO;
$template->emailFrom = EMAIL_FROM;
$template->serverName = SERVER_NAME;
$mailer = new \Nette\Mail\SendmailMailer;

In mail.latte is this sample
<p><strong>{_'Zadané údaje'}:</strong></p>

Member | 118

there is no setTranslator() method in Latte\Engine, it is a method of Nette\Bridges\ApplicationLatte.
Get inspired by…ate.php.html#… on how to set up translator on Latte\Engine.

P.S. next time when you ask for something, tell how exactly your code doesn't work. It was just my raw (and probably correct) guess that you get error when calling $template->setTranslator:)