Re: [SMARTY-DEV] Parsing smarty tags inside plugins

From: Date: Thu, 26 Aug 2004 12:45:29 +0000
Subject: Re: [SMARTY-DEV] Parsing smarty tags inside plugins
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-2521@lists.php.net to get a copy of this message
On Thu, 2004-08-26 at 13:39 +0100, Marcus Bointon wrote: > I'm writing a Smarty plugin for handling translations. One thing I'd like to > be able to handle is embedding smarty tags in the translations. Can I do > this using the existing Smarty instance that's passed in to the plugin, or > do I need to fire up a separate instance and parse the translation text > before passing it back to the calling template? > > Are there any other factors I need to consider in this structure? > > Marcus When encountering the same questions, we had to take a totally different solution in the project I'm currently in. All translatable strings are put in {t}...{/t} tags, which are then being given to gettext. Anyway, we couldn't implement this as a block function, since smarty returns it's data parsed to the block function (making it impossible to embed smarty syntax). We are now using a system that precompiles the templates for each language (not the most ideal way), but the only simple way to do it. Regards, Ruben -- Ruben Vermeersch http://www.Lambda1.be/

« previous php.smarty.dev (#2521) next »