Re: translation
| From: | Mike Krus | Date: | Thu, 09 Aug 2001 19:39:17 +0000 |
| Subject: | Re: translation | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1323@lists.php.net to get a copy of this message | ||
--- Monte Ohrt <monte@ispi.net> wrote:
> Some time ago, I posted a SUGGESTION on how to enable smarty to
> handle translation in templates. The approach, I think, was generic
> enough not to interfere with those not needing translations (or
> enough performance to translate after compilation and no need for
> vars in the translated strings).
...
> Unfortunately, I got almost no feedback... Was my suggestion that
> stupid, was my intention not clear enough or am I the only one who
> likes this generic approach? If it annoys anyone on the list,
> please tell me.. I'm bringing it up again and again because
> translations are important for me ;)
for me to! I also got close no feedback for my proposal. My advice:
implement it, post your modified copy of Smarty, show it working
on your site, post your evaluation of how good it works.
I've implemented my proposal, it's in the HPE CVS repository [1].
It's working on NewsIsFree [2]. It's just what I wanted. Language
strings are in an XML file, templates are compiled to different
scripts per language, it's faster than using config strings, language
strings can contain smarty template code and variable (since
translation is done before compilation)...
Down side: template compile time is much longer (due to a big XML
file processing, but it's a one time operation), you need to specify
which language you want the template to be displayed in
(fetch("en.foo.tpl") or fetch("de.foo.tpl") or
fetch("$LANG.foo.tpl")),
and you have to repeat that in the include statements.
This was done with changing a single line in the original Smarty
distribution. Overall, made me like Smarty even more!
Mike
[1] http://sourceforge.net/projects/hpe/
[2} http://www.newsisfree.com/
=====
mwkrus @ yahoo.com
http://mkrus.free.fr/
http://www.newsisfree.com/
ICQ: 30900412
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/