Reply to Re: RFC 1766

Your name:

Reply:


Posted by Toby A Inkster on 07/25/07 22:20

Sergei Riaguzov wrote:
> Rik wrote:
>
>> Accept-Language: en-gb,en;q=0.8,nl;q=0.7,nl-be;q=0.5,de;q=0.3,fr;q=0.2
>
> And which one should be user locale? The first one?

The Accept-Language header doesn't tell you anything about the client
machine's locale. The client machine's locale is sometimes given in the
HTTP User-Agent header, but not always.

The Accept-Language header shows the client's preferred language. This may
not always be the same as the machine's locale. Say, for example, that the
user is fluent in Flemish, he might set Flemish to be his first choice of
Accept-Language, but his machine's locale may be French, because no
Flemish translation of the software is available.

Note that you don't always have to pick the first language on the list.
Say for example, I have a site that's in English; I've made a French
translation using an automatic service, but I'm under no illusions about
the quality of the translation. If a user comes along with a header like
this:

Accept-Language: fr

I'd probably serve up the poorly translated French version, with my
apologies. But if the header was like this:

Accept-Language: fr, en

I might send the English version, because even though the visitor prefers
French, I know my translation'snot up to scratch.

(Note that Apache is able to deal make these decisions itself. You just
tell it which translations of the content are available, and of what
quality they each are, and it will make the choice which version to serve.)

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 35 days, 1:43.]

Cryptography Challenge
http://tobyinkster.co.uk/blog/2007/07/24/crypto-challenge/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация