Re[2]: [SMARTY] Re: passing an array to an included template
| From: | Bertrand DUNOGIER | Date: | Mon, 13 May 2002 07:02:29 +0000 |
| Subject: | Re[2]: [SMARTY] Re: passing an array to an included template | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4177@lists.php.net to get a copy of this message | ||
l> Hi for my problem, I have made a dynamic change of the smarty template dir.
l> templatedir/en/
l> templatedir/fr/
l> etc...
l> So I have duplicate the templates to have the both languages.
This method sounds like the more logical, but in the end it is not
that efficient. On most projects, having to keep up to date a set of 2
identical templates is very very heavy and a big loss of time.
I rather use a {translate} function, that takes the language and the
string in the different languages as a parameter. By instance:
{translate lang=$LANG en='en string' fr='fr string'}
It works very well on the project i am on at the moment.
Bertrand