Re: [SMARTY] Multilangual support for websites
| From: | Bertrand DUNOGIER | Date: | Sun, 02 Jun 2002 19:47:50 +0000 |
| Subject: | Re: [SMARTY] Multilangual support for websites | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4502@lists.php.net to get a copy of this message | ||
RC> i have a config-file for each template. for every language a have
RC> a section in each config-file. then i have a language variable as
RC> well. let's say $lng and it's assigned to each template.
RC> in the templates then i say
RC> {config_load file="filename" section=$lng}
This method takes in my opinion too much time to implement. You have
to modify every template the designer gives you to make it fit the
multilingual system...
What i'm using at the moment is a very simple {translate} function,
which takes as an optionnal argument the language, or uses the session
var $_SESSION['lang'] and echoes the corresponding string.
Example:
{translate fr='texte francais' en='english text'}
until now, it worked perfectly.
Bertrand