Re: Re: Question about development

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Jason Pruim wrote:

On Feb 12, 2008, at 2:09 PM, Aleksandar Vojnovic wrote:

Could you explain this a little better - "...into using a database[1] for storing the pages and using browser sniffing to find out what language preference they currently had
selected to display in that language"?

Aleksandar


I'll try my best to :)

I have heard from people (Haven't done it my self) that it is possible and reliable, to use the browsers language setting which gets transmitted in one of the headers (Not sure which one off hand) to initially select the language for the site from your database. IE: If you speak english, and have english selected as your browser language preference, it will send that to the server, when your script sees it, it's a fairly good assumption that that would be the preferred language to display in, so the server pushes up the english version of the site.

Obviously, you need to have the actual translated files stored on your server to choose from. And, you should always give them away of overriding the guessed option, just in case they really don't want to use what it appears like they do :)

Does that explain it better?


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
japruim@xxxxxxxxxx

Browsers generally send the the HTTP_ACCEPT_LANGUAGE header in a request.

$_SERVER[HTTP_ACCEPT_LANGUAGE] => en-gb,en;q=0.5

thus with mine, preference is en-gb, failing that anything en; failing that whatever you've got.

ACCEPT_CHARSET is worth a check often aswell; finally POST requests can also have a CONTENT_LANGUAGE specified which describes the lang of the content.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux