Using the translate macro witout Nette

Wintermute
Member | 11
+
+1
-

Hello,

According to the Latte documentation, the translation macros are available only in Nette Framework.

{_}hello_world{/_}

Actually, you can make it work without Nette. You just have to provide a translate filter.

In my framework, I do the following :

$latte->addFilter( 'translate', [Registry::get( 'i18n' ), '__'] );
$latte->addFilter( '__', [Registry::get( 'i18n' ), '__'] );

It works perfectely !