Robert Goldsmith <rgoldsm...@...> writes:

> As part of my integration into Zend Framework, I wrote a replacement
translator service for phptal. you
> basically just write a class that implements PHPTAL_TranslationService and
then when you create the
> phptal instance you call its 'setTranslator' method and pass in an instance of
your class.
> I assume that the translator service is not actually called at compile time -
only at runtime. Obviously if
> you use something like Zend you can make use of memcache to hold the
translation keys in a cache (which works
> very well) but translating static text at compile time (if it doesn't already
happen) would require
> deeper modification of phptal.
> As an aside, I also make use of Zend's plural support and use a custom tales
modifier to pass in the
> translation keys for singular and plural and then the variable with the value
used to decide on the actual
> key to use. It works very well for me :)
> Robert

Hi Robert,

Gettext translation being already loaded in memory, I suppose there's not much
difference calling gettext method rather than fetching variables from memcache
or other shared memory system.
When it comes to complex templates, I assume it would save some memory
and CPU cycles to have a already translated static template at run time.
I presume that indeed there's heavier work as some part of
phptal has to be rewritten.
Maybe Kornel could advise on what would be the best entry point
to modify phptal behaviour?
I also read on that thread :
that laurent, the initiator of phptal project did some work on
what i'm trying to achieve.
Wouldn't be some interesting way of improving phptal in futures evolutions?

Thanks in advance for your input guys.


PHPTAL mailing list

Reply via email to