[Phplib-users] Templates and i18n...
Brought to you by:
nhruby,
richardarcher
|
From: Aric C. <gre...@pe...> - 2002-12-02 22:44:56
|
I've been adapting my code to use a getText() function to provide =
translated strings. Using templates, I then setvar() all the strings =
from getText() and put appropriate {} tags into the templates.
It occured to me that this could be much simpler. Why not have the =
template class do it for you? You could "register" your custom =
getText() function (subclass the template object). Then when ever the =
template parser encounters a translatable string it calls the function. =
A translatable string could be identified in the template like so: =
{"this is a string"}. This would reduce the amount of coding needed, =
and would make it easier for the template designer.
I think it would be pretty easy to add. Any thoughts?
|