Re: authoring @lang and @dir (was 3.6. The root element)

On Aug 1, 2007, at 8:53 PM, Robert Burns wrote:

>
> I'm not really sure what you're asking. But what I'm trying to say  
> is that fully expressing a language using @lang or @xml:lang  
> provides all of the information required to deduce the  
> directionality. So to take just one of the examples I gave above:
>
> lang='iw-LATN'=> dir='LTR'
>
> In that case the @dir attribute is technically redundant. I'm not  
> saying that UAs work that way now. Rather I'm saying that by  
> specifying language (including the specification of unconventional  
> scripts), all the information is there to determine directionality.  
> For some languages what demarcates the unconventional script may be  
> up for debate and can even be a political football. If the web was  
> around a century ago or so when Turkey was imposing a change from  
> Arabic to Latin script, it would be difficult to say which was the  
> conventional script. It would probably require specifying precisely  
> which one was in use either way (if the government permits it).
>
> Again, though having @dir as a separate attribute saves UAs from the  
> need to process language codes to determine directionality. It also  
> is more flexible in the sense that an author can specify only @dir  
> and leave @lang unspecified. Or specify @dir and @lang but provide  
> only the primary language code with no script code. Doe that answer  
> your question?

HTML4 says that "User agents must not use the lang attribute to  
determine text directionality", and current user agents respect this.  
It is highly likely that content depends on lang and dir being treated  
separately. So reversing this requirement in HTML5 would likely not be  
compatible with existing content.

Note that dir only affects directionally neutral characters, not  
characters from scripts with inherent directionality, so there are  
valid reasons to write text in various languages that uses either dir  
value.

Regards,
Maciej

Received on Thursday, 2 August 2007 07:21:49 UTC