You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ben Laurie <be...@algroup.co.uk> on 1998/01/08 16:03:57 UTC

Default Language?

If you are using AddLanguage for language support, and the client wants
a language you haven't got, how do you set what langauge variant they
actually do get?

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Re: Default Language?

Posted by Ben Laurie <be...@algroup.co.uk>.
Martin Kraemer wrote:
> 
> On Fri, Jan 09, 1998 at 08:42:24AM +0000, Ben Laurie wrote:
> > Not where I'm testing it. What we actually get is the Polish version!
> 
> You have perl sources lying around, right? ;-)

Errr. Yes. If you are suggesting that we've got a .pl problem, we use
.po for Polish...

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Re: Default Language?

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Fri, Jan 09, 1998 at 08:42:24AM +0000, Ben Laurie wrote:
> Not where I'm testing it. What we actually get is the Polish version!

You have perl sources lying around, right? ;-)

    Martin
-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Re: Default Language?

Posted by Ben Laurie <be...@algroup.co.uk>.
Martin Kraemer wrote:
> 
> On Thu, Jan 08, 1998 at 03:03:57PM +0000, Ben Laurie wrote:
> > If you are using AddLanguage for language support, and the client wants
> > a language you haven't got, how do you set what langauge variant they
> > actually do get?
> 
> Don't you get a "406 Not Acceptable" in this situation?

Not where I'm testing it. What we actually get is the Polish version!

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Re: Default Language?

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Fri, Jan 09, 1998 at 11:14:45AM +0000, Paul Sutton wrote:
> Yep, that's right. Of course you could always call it
> 
>   Welcome.shtml.shtml
> 
> That'll force content negotiation for Welcome.shtml requests, but without
> altering it is.

Now THAT'S tricky!  Yep, works fine.
Thanks for the idea!

   Martin
-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Re: Default Language?

Posted by Lars Eilebrecht <La...@unix-ag.org>.
According to Martin Kraemer:

>  Oh yeah: the LanguagePriority is only for those requests who don't contain
>  a "Accept-Language:" header.

Yep.
We have a change-request for a 'default language' feature. See PR#1180.

Anyone out there with some spare time? ,-)


ciao...
-- 
Lars Eilebrecht                - If idiots could fly, MSN would be an airport!
sfx@unix-ag.org
http://www.si.unix-ag.org/~sfx/


Re: Default Language?

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Thu, Jan 08, 1998 at 06:06:33PM +0100, Martin Kraemer wrote:
> If the symlink /Welcome.shtml -> /Welcome.shtml.en is missing, then a 
> request for "/Welcome.shtml" will deliver the german version for the
> german user, the english version for all users who at least have "en"
> defined as one of their languages, and "406" and the list of alternatives
> for anyone else.

Oh yeah: the LanguagePriority is only for those requests who don't contain
a "Accept-Language:" header. It works as if the request _had_ had a 
"Accept-Language:" with the list of languages defined in LanguagePriority.

   Martin
-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Re: Default Language?

Posted by Paul Sutton <pa...@eu.c2.net>.
On Thu, 8 Jan 1998, Martin Kraemer wrote:
> On Thu, Jan 08, 1998 at 04:37:01PM +0000, Paul Sutton wrote:
> > Yep, that's right. You should have a "Welcome.shtml" as a default (perhaps
> > a symlink to one of the language files). This language-neutral version
> > will only be picked if none of the user's preferred languages are
> > acceptable. 
> 
> Oh! Thanks for pointing that out!
> 
> However, it depends on what you request: suppose I have
>   /Welcome.shtml.de
>   /Welcome.shtml.en
>   /Welcome.shtml -> /Welcome.shtml.en
> 
> Now when a user with "Accept-Language: fr" requests "/Welcome", she gets
> the english version, and a german user will get the german version. In fact,
> _only_ the german user will get the german version.
> 
> But when the request asks for "/Welcome.shtml", then even the german user
> will get the english version.... When a matching file is found, no
> negotiation is attempted.
> 
> If the symlink /Welcome.shtml -> /Welcome.shtml.en is missing, then a 
> request for "/Welcome.shtml" will deliver the german version for the
> german user, the english version for all users who at least have "en"
> defined as one of their languages, and "406" and the list of alternatives
> for anyone else.

Yep, that's right. Of course you could always call it

  Welcome.shtml.shtml

That'll force content negotiation for Welcome.shtml requests, but without
altering it is.

//pcs


Re: Default Language?

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Thu, Jan 08, 1998 at 04:37:01PM +0000, Paul Sutton wrote:
> Yep, that's right. You should have a "Welcome.shtml" as a default (perhaps
> a symlink to one of the language files). This language-neutral version
> will only be picked if none of the user's preferred languages are
> acceptable. 

Oh! Thanks for pointing that out!

However, it depends on what you request: suppose I have
  /Welcome.shtml.de
  /Welcome.shtml.en
  /Welcome.shtml -> /Welcome.shtml.en

Now when a user with "Accept-Language: fr" requests "/Welcome", she gets
the english version, and a german user will get the german version. In fact,
_only_ the german user will get the german version.

But when the request asks for "/Welcome.shtml", then even the german user
will get the english version.... When a matching file is found, no
negotiation is attempted.

If the symlink /Welcome.shtml -> /Welcome.shtml.en is missing, then a 
request for "/Welcome.shtml" will deliver the german version for the
german user, the english version for all users who at least have "en"
defined as one of their languages, and "406" and the list of alternatives
for anyone else.

   Martin
-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Re: Default Language?

Posted by Paul Sutton <pa...@eu.c2.net>.
On Thu, 8 Jan 1998, Martin Kraemer wrote:
> On Thu, Jan 08, 1998 at 03:03:57PM +0000, Ben Laurie wrote:
> > If you are using AddLanguage for language support, and the client wants
> > a language you haven't got, how do you set what langauge variant they
> > actually do get?
> 
> Don't you get a "406 Not Acceptable" in this situation?

Yep, that's right. You should have a "Welcome.shtml" as a default (perhaps
a symlink to one of the language files). This language-neutral version
will only be picked if none of the user's preferred languages are
acceptable. 

//pcs



Re: Default Language?

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Thu, Jan 08, 1998 at 03:03:57PM +0000, Ben Laurie wrote:
> If you are using AddLanguage for language support, and the client wants
> a language you haven't got, how do you set what langauge variant they
> actually do get?

Don't you get a "406 Not Acceptable" in this situation?

   Martin
----------------------------
<HTML><HEAD>
<TITLE>406 Not Acceptable</TITLE>
</HEAD><BODY>
<H1>Not Acceptable</H1>
An appropriate representation of the requested resource / could not be found on this
server.<P>
Available variants:
<ul>
<li><a href="Welcome.shtml.de">Welcome.shtml.de</a> , type text/x-server-parsed-html,
 language de
<li><a href="Welcome.shtml.en">Welcome.shtml.en</a> , type text/x-server-parsed-html,
 language en
</ul>
<HR>
<ADDRESS>Apache/1.3b4-dev Server at <A HREF="mailto:Martin.Kraemer@mch.sni.de">deejai.mch.sni.de</A> Port 80</ADDRESS>

-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Re: Default Language?

Posted by Dirk-Willem van Gulik <Di...@jrc.it>.
Would not

LanguagePriority	it kr fr de en

Do the trick ? Assuming no map file is there.

DW.

On Thu, 8 Jan 1998, Ben Laurie wrote:

> If you are using AddLanguage for language support, and the client wants
> a language you haven't got, how do you set what langauge variant they
> actually do get?
> 
> Cheers,
> 
> Ben.
> 
> -- 
> Ben Laurie            |Phone: +44 (181) 735 0686|Apache Group member
> Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
> and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
> A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
> London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache
> 

http://cils.ceo.org                         http://enrm.ceo.org
dirkx@technologist.com                     Dirk.vanGulik@jrc.it
+39 332 78 0014       +39 332 78 9549       fax +39 332 78 9185
ISEI/ESBA;                     The Center For Earth Observation
Joint Research Centre of the European Communities, Ispra, Italy