Re: User's language settings
| From: | Daniel Schierbeck | Date: | Mon, 08 Nov 2004 22:16:46 +0000 |
| Subject: | Re: User's language settings | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-201575@lists.php.net to get a copy of this message | ||
Marek Kilimajer wrote:
Dmitri Pissarenko wrote:-- Daniel Schierbeck Help spread Firefox (www.getfirefox.com): http://www.spreadfirefox.com/?q=user/register&r=6584Hello! I have a web-site, part of which is in Russian and another part in English. English and Russian parts are located in different directories. The web-site is static. I want to create a PHP file, which redirects the user from /index.php to /ru/index.html, when his primary language is Russian and to /en/index.html, when his primary language is non-Russian. In other words: <?php if ($languageRussian) { header("Location: http://dapissarenko.com/ru/index.html"); } else { header("Location: http://dapissarenko.com/en/index.html"); } exit; ?> How can I determine user's primary language? Thanks! dap$_SERVER["HTTP_ACCEPT_LANGUAGE"] - string with user's language preferences. However only a fraction of users willingly set it, so many times it will be on its default value, english even for russian speaking visitors. Yup. I think it's better if you let the visitors decide.