On 11 Jun 2009, at 18:03, michal wrote:

I have created automatic translation system.

BTW: PHPTAL has support for custom translation solutions, see PHPTAL_TranslationService interface.

And from the point of view of
class that inherit translated words there is problem with loops inside template
that they have to be inside of array.
I have some function like
$lang->load('admin_panel',$tpl); $tpl is pass through reference and all
translation is inside $tpl.

You shouldn't be doing this. Don't spread PHPTAL as dependency all over the application.

The problem is with structure of data.
I have temporary solution that $translation_obj contains all translated word as
object(and is accesible, $tpl is not).
$translation_obj = $lang->load('admin_panel',$tpl);
But that would be faster and more coniniet to have possiblity to access $tpl
directly like
echo $tpl->manage
or echo $tpl->get('manage');

Well, it certainly wouldn't be faster, because access to variables from PHPTAL object is quite slow (they are stored in this object).

And I really don't get it why do you want to use PHPTAL class for managing translations, rather than some other class that's designed for that purpose.

regards, Kornel

PHPTAL mailing list

Reply via email to