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

[email protected] (Ruben Vermeersch)
Newsgroups php.smarty.dev
Message-ID <1093524329.28192.2.camel@ruben>
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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.