Re: Multi-language and Smarty
| From: | Raymond Penners | Date: | Tue, 29 Jan 2002 09:56:51 +0000 |
| Subject: | Re: Multi-language and Smarty | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2593@lists.php.net to get a copy of this message | ||
Alain Fontaine - Consultant and developer wrote:
I will shortly begin work on a very large portal-type site for a local city that has to be made available in at least 2, but probably more, languages. I will be using Smarty for this site. Have you already developed multi-language sites using Smarty? What is the best approach?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