Re: Multi-language and Smarty
| From: | Andrei Zmievski | Date: | Tue, 29 Jan 2002 14:20:24 +0000 |
| Subject: | Re: Multi-language and Smarty | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2596@lists.php.net to get a copy of this message | ||
That is the approach that we will most likely be using for i18n in our
flagship Vnews application.
On Tue, 29 Jan 2002, Raymond Penners wrote:
> One approach we are taking at our company is the following:
>
> --8<--[example.conf]--8<----8<----8<----8<----8<--
> [en]
> message="Message"
> other=...
>
> [de]
> message="Meldung"
> other=...
>
> [nl]
> message="Bericht"
> other=...
> --8<----8<----8<----8<----8<--
>
> --8<--[example.html]--8<----8<----8<----8<----8<--
> {config_load file="example.conf" section="$language"}
> <html>
> <body>
> {#message#}
> </body>
> </html>
> --8<----8<----8<----8<----8<--
>
> --8<--[example.php]--8<----8<----8<----8<----8<--
> // Fancy function that parses HTTP_ACCEPT_LANGUAGE
> // and returns one of 'en', 'de', or 'nl'.
> $language = getLanguage(array('en','de','nl'));
>
> $smarty = new Smarty();
> $smarty->assign('language', $language);
> $smarty->display();
>
> --8<----8<----8<----8<----8<--
>
> --
> Raymond Penners -*- raymond@dotsphinx.com -*- www.dotsphinx.com
>
>
> ---
> You are currently subscribed to smarty as: andrei@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
-Andrei
* We are not a clone. *