Re: Multi-language support for PHP
| From: | Nicolas Hoizey | Date: | Mon, 11 Dec 2000 17:21:59 +0000 |
| Subject: | Re: Multi-language support for PHP | ||
| References: | 1 2 | Groups: | php.i18n |
| Request: | Send a blank email to php-i18n+get-86@lists.php.net to get a copy of this message | ||
Hi all,
> With Multiviews you would create files like:
> test.php3.en
> test.php3.kr
> test.php3.es
> and then when people configure their browsers to define the language
> preference order which results in the browser sending a header like:
> Accept-Language: kr en
> Multiviews ends up selecting the test.php3.kr file when the browser
> requests test.php3
That's what I have done in phpLang, which you can use on a web site to
manage multiple languages, as english and french on phpHeaven.
But phpLang is more powerfull than Apache's Multiviews :
1- It can set a cookie to remember last prefered language on a particular
web site : I'm french, but I usually prefer to look at the english version
of a web site as it is often the most up to date version, and I configured
my browser with english in first accepted language. If I now look at a
french web site with both english and french versions, I would prefer to
look at the french one, and it will be great if my browser "remembers" that
through a cookie. Do you see what I mean ?
2- It look at the browser's "name" to find any language information if
"accept-language" doesn't give any.
3- You can have language specific files in another directory than the main
file.
4- You can use it on any ISP, where you can't modify Apache's config
and so on ...
I hope you'll find this usefull ... :)
Regards,
Nicolas.
_______________________________________________
Nicolas HOIZEY nhoizey@phpheaven.net
phpMyChat & phpLang : http://www.phpheaven.net/
private joke : "Créateur de sites, intelligent"