Re: More ideas for translation support (long)
| From: | Hans-Peter Oeri | Date: | Mon, 23 Jul 2001 21:51:52 +0000 |
| Subject: | Re: More ideas for translation support (long) | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1264@lists.php.net to get a copy of this message | ||
Hi!
Quoting Mike Krus <mwkrus@yahoo.com>:
> > something else than files? Wouldn't that mean to write a lang: handler
> for each
> > other resource?
> I don't get it. What is your point?
Let's say I get some templates out of files and others out of some db or
function call. Your "lang" resource handler can only handle one of them at a
time, no? So, in my example, I would have to write a "lang-file" and a
"lang-db" resource handler...
> filters won't work because there is one to one mapping between
> template names and compiled scripts names.
That's what I tried to describe: Change that mapping to 1:n
Now if we include some sort of "compiled-template-file-name-rewrite" (see my
last posts), that functionality could be used in different ways! Just one of
them are translations...
Getting the translation in pre-filters offers then the possibility to use
whatever method you want. OK, one could probably ship different "standard"
translation handlers to choose from... But if someone doesn't want any
translation support or just a different approach to translation, he/she is
free to do so.
I'm definitely in favour of that split approach to include a "rewrite magic"
hook in the core and let the translation consist of
a) a handler that plugs in the "rewrite magic" hook
b) a prefilter that does the translations
Don't conform!
IkKampfCaspar75