Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Translate function

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
DonDa
Smarty n00b


Joined: 20 Nov 2009
Posts: 1

PostPosted: Fri Nov 20, 2009 5:17 pm    Post subject: Translate function Reply with quote

Hi there,

I'm currently upgrading Smarty 2 to 3.

But: In the previous version a had made a custom translate function something like this [#KEY.TO.TRANSLATE#].

Now i did it there with extending the smarty.class with the _compile_source function that was avaible then.

But this function is now disappeared or replaced?

How can i fix this? There's no documentation for Smarty 3 so it makes it hard to find it on my own.

Thanks and sorry for the lacky English.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7367
Location: Lincoln Nebraska, USA

PostPosted: Fri Nov 20, 2009 7:53 pm    Post subject: Reply with quote

Instead of hacking Smarty 2 OR 3, I'd recommend using a prefilter to replace the [#KEY.TO.TRANSLATE#] to the corresponding text or function calls, then let the compiler handle them as per usual.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP