Re: Newbie asks about multi-lingual website strategies
| From: | Colin Guthrie | Date: | Tue, 27 Nov 2007 23:31:53 +0000 |
| Subject: | Re: Newbie asks about multi-lingual website strategies | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-265103@lists.php.net to get a copy of this message | ||
tedd wrote:
> At 11:05 PM +0100 11/27/07, Jochem Maas wrote:
>> tedd wrote:
>>
>> > If it were me, I wouldn't use any problematic browser detects schemes
>>> (they don't work) or any of that high-thought stuff -- it's beyond me.
>>
>> whether it's beyond you or not only you can judge, but I disagree that
>> it's
>> problematic. I should note that I recommend using browser language
>> preference
>> detection (as per my previous post) as a means to initially select a
>> [hopefully]
>> suitable language BUT that this should be done in addition to offer
>> the user
>> an explicit mechanism for language selection.
>
> My "beyond me" statement was meant in jest, but browser sniffing is
> notorious for being inaccurate and the practice is highly controversial.
>
> http://en.wikipedia.org/wiki/Browser_sniffing
Sorry Tedd, but I'm not sure where the browser sniffing stuff came in.
IE and FF both offer a UI to input the user's preferred language, it's
an HTTP standard thing and nothign to do with user agents string
parsing. It uses the Accept-Language header sent with http requests to
detect the language. It's quite standard but problems usually crop up in
e.g. Australia and the UK where a lot of people leave the default en-US
language when en-GB or en-AU would be better. Again it's not infallible
but it's a fairly good starting point.
Another approach would be to use a geoip database and try and look up
the users IP address but, if anything, I'd say that is even less
accurate than the above.
Col