Re: hreflang

Laurens Holst wrote:
> 
> Oskar Welzl schreef:
>> Dear members of www-html,
>>
>> I was really afraid I'd be at least 2 years late to re-discuss @hreflang
>> in XHTML 2 now. Browsing the lists' archives every now and then, though,
>> I see there are others sharing my concerns. So sat down and tried one
>> more effort on
>>
>> Why @hreflang Should Be Handled As In HTML 4.01 
>> ===============================================
>> (by me, written in a foreign language late at night. Please be
>> indulgent.)
>>
>> In short, it shouldn't change to what the current public working draft
>> proposes (multi-value, changing the accept-language request header)
>> because
>> - it's superfluous that way
>> - it's difficult to handle with CSS
>> - it's http only and denies XHTML's use as a general markup language
>> - it leads to bad user experience
>> - it's based on a questionable concept that is hardly used
>> - browser behaviour isn't specified
>> As an alternative, I propose @hreflang to be used the same way it was
>> meant in HTML 4.01 plus the introduction of an additional @acceptlang
>> (or @getlang) to satisfy those who really, really want it the way the
>> XHTML 2.0 draft reads now.
> 
> I agree with this proposal.
> 
> My main reasons for disagreeing with the re-specification of hreflang 
> are that:
> - Hreflang is already used in a sensible manner and we would loose that 
> ability in the new specification.
> - The author of a website can’t make a well-judged decision on which 
> languages his visitors can and prefer to read. The user has indicated 
> language preferences in his browser, and those should not be ignored.
> 
> Because of the sensible examples Oskar mentioned in his section B.), I 
> do think it’s somewhat valueable to introduce an @acceptlang attribute, 
> although I have doubts as to whether user agents will actually implement 
> it, and whether I would really care when that doesn’t happen.

Let's take an example, and compare the behaviour differences between 
HTML4 and XHTML2 when using this attribute.

When you write hreflang="ja" is is meant to be an assertion that the
referenced resource is in Japanese.

What you will see is that in all cases in HTML4 where this assertion is 
correct, and you get a  Japanese document, you get the same Japanese 
document in XHTML2.

In cases in HTML4 where despite the assertion you get a non-Japanese
document (i.e. where the assertion is apparently incorrect), XHTML2 does 
better, either giving you a Japanese document after all, or giving the 
webmaster the opportunity to explain to the user why the document is not 
in Japanese, and what *is* available.

In other words, the only thing that changes in the XHTML2 version is the 
error behaviour, i.e. what happens when the assertion is incorrect.

Here's the example:

Suppose someone whose preferred language (in their browser language
preferences) is German clicks on

 <a href="doc" hreflang="ja">The document in Japanese</a>

in an HTML4 document and in an XHTML2 document.

There are several possibilities for the resource named "doc":
1) It is only available in Japanese
2) It is available according to accept-lang in Japanese, in German,
    and several other languages (an example is
 http://www.w3.org/MarkUp/Forms/2003/xforms-for-html-authors,
    which will be served according to your language preferences)
3) It is not available in Japanese, but only in Chinese
4) It is only available in Chinese and German
5) It is only available in Chinese and Thai

Here is what a user who is expecting a Japanese document will get in 
each case:

HTML4  XHTML2
1)Japanese Japanese
2)German Japanese
3)Chinese Depends on webmaster
4)German Depends on webmaster
5)Random Depends on webmaster

"Depends on webmaster" means that the webmaster can decide how to 
respond to requests for a Japanese version of a document that isn't 
available in Japanese, for instance by listing links to the language 
versions that are available.

So the new definition gives you the correct result more often, and a 
chance to give an explanation in error cases.

I would strongly assert that this is better user experience, and finally 
actually makes the hreflang attribute useful, something more than the 
comment it is in HTML4.

Best wishes,

Steven Pemberton

Received on Monday, 6 February 2006 11:30:09 UTC