You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Joshua Slive <sl...@finance.commerce.ubc.ca> on 2001/02/08 22:13:23 UTC

Re: Language Negotiation: "No Acceptable Variant"

On Mon, 29 Jan 2001, Brian Behlendorf wrote:
> We could easily modify the text to make it look less like an error and
> more like an informational thing, e.g.
>
>   We do not have the document in the languages you've indicated you
>   accept, which are '$lang'.  We do have the documents available in other
>   languages, though, which we provide direct links to below.  If you are
>   able to read one of these other languages, we urge you to consider
>   configuring your browser to indicate an acceptance of these languages.
>
> To be really slick, we could provide the above error message in one of the
> acceptable languages.
>
> I'm worried that just assuming that a 406 means an error means "give them
> an english document" is a viewpoint too English-centric.
>

I want to restart this thread, because it never came to a conclusion.

Brian's idea is fine, but pretty much impossible to implement, in my
opinion (at least as far as providing the error message in multiple
languages).  On the other hand, it would be great if enough information
could be provided in the environment such that a custom ErrorDocument
could be used to list all the available variants.

Then here's where the fun part comes: what if you don't have an
ErrorDocument in any of the "acceptable" languages?  In general, the
webmaster is the one best able to know what language should be served in
that case.  For example, in httpd.apache.org, that would clearly be
english, while in www.apache.jp, it would clearly be japanese.

Currently, in order to implement such a "fall-back" page with MultiViews,
it is necessary to have a page with an extension that is not mapped to any
particular language.  (eg. index.html.html in the case of the Apache 1.3
docs.)  It has been suggested (and I think it is a good idea), that there
should be some sort of FallBackLanguage directive that could tell Apache
to use a specific language-page when the accept negotiation would otherwise
fail.

So that is two suggestions:

1. Find a way to provide ErrorDocument with enough information so that
webmasters can customize the "No Acceptable Variants" message.  This could
also be useful for mod_speling.

2. Add a "FallBackLanguage" directive to use when negotiation fails.

These directives could be combined such that ordinary content gets the "No
Acceptable Variants" ErrorDocument when negotiation fails, but the
ErrorDocument itself is subject to the FallBackLanguage directive in case
it can't find a good language.

And possibly:

3. Change the default text of the "No Acceptable Variants" page to be
a little more friendly, at least in English.

Unfortunately, I don't know this code nearly well enough to even start
implementing this stuff.

To improve the present state of the Apache docs (and help out the millions
of people with "misconfigured" browsers) I suggest immediately including
an index.html.html page in the docs which has either:

1. <!--#include virtual="index.html.en" -->
or
2. A helpful error message explaining how to configure browsers
accept-language setting.

Sorry for the excessively long message, but I would like to come to some
sort of conclusion.

Joshua


Re: Language Negotiation: "No Acceptable Variant"

Posted by James Sutherland <ja...@cam.ac.uk>.
On Thu, 8 Feb 2001, Koen Holtman wrote:

> 
> 
> On Thu, 8 Feb 2001, Joshua Slive wrote:
> 
> [....]
> > So that is two suggestions:
> > 
> > 1. Find a way to provide ErrorDocument with enough information so that
> > webmasters can customize the "No Acceptable Variants" message.  This could
> > also be useful for mod_speling.
> > 
> > 2. Add a "FallBackLanguage" directive to use when negotiation fails.
> > 
> > These directives could be combined such that ordinary content gets the "No
> > Acceptable Variants" ErrorDocument when negotiation fails, but the
> > ErrorDocument itself is subject to the FallBackLanguage directive in case
> > it can't find a good language.
> > 
> > And possibly:
> > 
> > 3. Change the default text of the "No Acceptable Variants" page to be
> > a little more friendly, at least in English.
> > 
> > Unfortunately, I don't know this code nearly well enough to even start
> > implementing this stuff.
> 
> If I recall correctly, the message under 3. above is hard-coded in
> mod_negotiation, and it will be fairly trivial to hard-code some
> additional english text in it.
> 
> I think that 2. Add a "FallBackLanguage" directive is a good enough idea
> that, if there is some wider consensus here that this directive would be a
> good thing to have, I am volunteering to code up a patch for it (I think
> this would take me a day of work).
> 
> I know too little about Apache internals to guess how much work 1. would
> be...

I once did something vaguely similar to mod_speling using an ErrorDocument
CGI, so I don't think it would be too hard. Option 2 was my idea
originally, though, so I think I still prefer that :-)


James.


Re: Language Negotiation: "No Acceptable Variant"

Posted by James Sutherland <ja...@cam.ac.uk>.
On Thu, 8 Feb 2001, Koen Holtman wrote:

> 
> 
> On Thu, 8 Feb 2001, Joshua Slive wrote:
> 
> [....]
> > So that is two suggestions:
> > 
> > 1. Find a way to provide ErrorDocument with enough information so that
> > webmasters can customize the "No Acceptable Variants" message.  This could
> > also be useful for mod_speling.
> > 
> > 2. Add a "FallBackLanguage" directive to use when negotiation fails.
> > 
> > These directives could be combined such that ordinary content gets the "No
> > Acceptable Variants" ErrorDocument when negotiation fails, but the
> > ErrorDocument itself is subject to the FallBackLanguage directive in case
> > it can't find a good language.
> > 
> > And possibly:
> > 
> > 3. Change the default text of the "No Acceptable Variants" page to be
> > a little more friendly, at least in English.
> > 
> > Unfortunately, I don't know this code nearly well enough to even start
> > implementing this stuff.
> 
> If I recall correctly, the message under 3. above is hard-coded in
> mod_negotiation, and it will be fairly trivial to hard-code some
> additional english text in it.
> 
> I think that 2. Add a "FallBackLanguage" directive is a good enough idea
> that, if there is some wider consensus here that this directive would be a
> good thing to have, I am volunteering to code up a patch for it (I think
> this would take me a day of work).
> 
> I know too little about Apache internals to guess how much work 1. would
> be...

I once did something vaguely similar to mod_speling using an ErrorDocument
CGI, so I don't think it would be too hard. Option 2 was my idea
originally, though, so I think I still prefer that :-)


James.


Re: Language Negotiation: "No Acceptable Variant"

Posted by Koen Holtman <ko...@hep.caltech.edu>.

On Thu, 8 Feb 2001, Joshua Slive wrote:

[....]
> So that is two suggestions:
> 
> 1. Find a way to provide ErrorDocument with enough information so that
> webmasters can customize the "No Acceptable Variants" message.  This could
> also be useful for mod_speling.
> 
> 2. Add a "FallBackLanguage" directive to use when negotiation fails.
> 
> These directives could be combined such that ordinary content gets the "No
> Acceptable Variants" ErrorDocument when negotiation fails, but the
> ErrorDocument itself is subject to the FallBackLanguage directive in case
> it can't find a good language.
> 
> And possibly:
> 
> 3. Change the default text of the "No Acceptable Variants" page to be
> a little more friendly, at least in English.
> 
> Unfortunately, I don't know this code nearly well enough to even start
> implementing this stuff.

If I recall correctly, the message under 3. above is hard-coded in
mod_negotiation, and it will be fairly trivial to hard-code some
additional english text in it.

I think that 2. Add a "FallBackLanguage" directive is a good enough idea
that, if there is some wider consensus here that this directive would be a
good thing to have, I am volunteering to code up a patch for it (I think
this would take me a day of work).

I know too little about Apache internals to guess how much work 1. would
be...

Koen.


Re: Language Negotiation: "No Acceptable Variant"

Posted by Koen Holtman <ko...@hep.caltech.edu>.

On Thu, 8 Feb 2001, Joshua Slive wrote:

[....]
> So that is two suggestions:
> 
> 1. Find a way to provide ErrorDocument with enough information so that
> webmasters can customize the "No Acceptable Variants" message.  This could
> also be useful for mod_speling.
> 
> 2. Add a "FallBackLanguage" directive to use when negotiation fails.
> 
> These directives could be combined such that ordinary content gets the "No
> Acceptable Variants" ErrorDocument when negotiation fails, but the
> ErrorDocument itself is subject to the FallBackLanguage directive in case
> it can't find a good language.
> 
> And possibly:
> 
> 3. Change the default text of the "No Acceptable Variants" page to be
> a little more friendly, at least in English.
> 
> Unfortunately, I don't know this code nearly well enough to even start
> implementing this stuff.

If I recall correctly, the message under 3. above is hard-coded in
mod_negotiation, and it will be fairly trivial to hard-code some
additional english text in it.

I think that 2. Add a "FallBackLanguage" directive is a good enough idea
that, if there is some wider consensus here that this directive would be a
good thing to have, I am volunteering to code up a patch for it (I think
this would take me a day of work).

I know too little about Apache internals to guess how much work 1. would
be...

Koen.