Hi,
I've been looking at getting the preferred locale and I have a couple of
questions.
I see that getPreferredVariant() uses apaches content negotiation
algorithm
(http://httpd.apache.org/docs/2.2/en/content-negotiation.html#algorithm)
which includes using the Accept-Language header:
"|Accept-Language: en-gb,en;q=0.5"
I'm unsure how (if) this comes into play or how to use it to get the
preferred language.
I added Language.FRENCH only to a variant and added it to
Resource.getVariants() thinking it may use it in content negotiation, it
seems not.
If this worked as expected I propose a method like
Resource.||getPreferredVariant().getPreferredLanguage()|| to get the
preferred locale.|||
|
|| If the client's language does not match then 406 or use a default
language. Make it backwards compatible by only using that algorithm when
languages are set?
Any help, thoughts appreciated
jon
|||
||