Re: translation suppport in smarty
| From: | Tomas Sanchez Romani | Date: | Tue, 10 Jul 2001 09:08:40 +0000 |
| Subject: | Re: translation suppport in smarty | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1148@lists.php.net to get a copy of this message | ||
A thought:
> The question is how Smarty should
> support you building multilingual sites.
>
I can't really tell how this should be implemented, but I think I'd want it
to look like:
{translation default=en}
{trans}Welcome to Smarty{/trans}
and for each locale specified elsewhere it would output a different compiled
template, such as:
index.sv.php, index.en.php, etc
This approach doesn't require the designer to know which locales to support,
which makes it very flexible.
For the implementation I just got an idea: what if smarty first looks thru
the template for trans-tags the inputs them in an array and calls stphp (or
something) with theese strings, who then returns an array for each locale
(or with the default language if missing).
enough is enough, tomas