Gettext icon indicating copy to clipboard operation
Gettext copied to clipboard

Smarty support

Open aolko opened this issue 8 years ago • 3 comments

Why you're ignoring smarty? Please support it.

aolko avatar Sep 02 '16 13:09 aolko

I'm not familiarized with smarty, but if you want to work in a pull request, I'd happy to include it.

oscarotero avatar Sep 02 '16 14:09 oscarotero

@aolko its working with https://github.com/smarty-gettext/smarty-gettext

edit I do not know why but when I edit language i must restart php

dusta avatar Mar 09 '17 11:03 dusta

@aolko @dusta

I do not know why but when I edit language i must restart php

You just need to copy the block.t.php file to the smarty plugin directory. The function.locale.php file is loading the php gettext extension, which caches the .mo files at apache start. But you don't need the that if you are using oscarotero's script. So just copy the block.t.php file to the plugin folder and you are done. Maybe adjust the original gettext functions to the one's recognised by oscarotero's script. E.g. change line $text = gettext($text); to $text = __($text); in the block.t.php file.

@oscarotero I've written a "function scanner" for smarty tpl files. It's kinda hacky but works for single strings with the smarty {t}MY STRING{/t} syntax. No comments and plural forms are implemented yet. Usage: Gettext\Extractors\Tpl::fromFile($file_path, $translations); gettext.zip

daheadcracker avatar Sep 20 '18 07:09 daheadcracker