smarty i18n
| From: | Konstantin Boshnyaga | Date: | Thu, 19 Jul 2001 12:40:12 +0000 |
| Subject: | smarty i18n | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-1199@lists.php.net to get a copy of this message | ||
Hello smarty!
I see the idea of translation like this:
$smarty = new Smarty();
$smarty->default_language="en";
$smarty->display("index.tpl", "ru"); or
$smarty->fetch("index.tpl", "ru");
In templates will be new tag {trans}{/trans} (or shoter version).
On template compiling phase, compiler will callback my function
for every found tag {trans}Hellow world!{/trans} which is
responsible for translation, with content between tags.
If function returns null, get the default text.
Template compiles for different language only once and stored like:
en.index.tpl.php
ru.index.tpl.php
I guess its better to have one template for all languages.
Any ideas ?
--
Best regards,
Konstantin mailto:ameoba32@mail.ru