lang="xx" inheritance and q bugWith iCab ß261 on Mac OS X 10.3.9, it appears that elements only mis-inherit the lang="xx" attribute from ancestor elements and any lang="xx" attribute for a particular element is ignored for that element. While it likely causes problems for search engines and other "machine" functions, it most visibly affects the display of proper, language-specific quotation marks using the q element.
An initial, rough version of this discussion and testcase can be found at http://homepage.mac.com/sardisson/icab/language_quotation_marks.html; see also Sander Tekelenburg's testcase, which includes CSS styling issues, at http://santek.no-ip.org/~st/tests/iCab/fixed/characters/language.php.
Update: There has been some debate as to whether the rendering in ß261 is actually the correct way to display the quotation marks (that is, the quotation marks are actually part of the ancestor text rather than part of the text they contain and thus should be displayed in the style of the language of the ancestor element rather than the language of the q element); see message 11227 and message 11228 in the iCab Yahoo! Group.
Nevertheless, the rendering in ß270 returned to match that of ß256 and iCab 2.9.8.
Update: This bug was fixed in ß270.
This document does not specify a lang="xx" attribute on the html element.
<DIV lang="en">
<OL>
<LI>He said, <Q>I speak English.</Q></LI>
<LI>He said, <Q>I speak English, and my brother said <Q>Hello!</Q> to me.</Q></LI>
<LI>Il dit <Q lang="fr">Je parle français.</Q></LI>
<LI>Il dit <Q lang="fr">Je parle français, et mon frère dit à moi <Q>Bonjour!</Q></Q></LI>
<LI lang="fr">Il dit <Q lang="fr">Je parle français, mais mon frère dit à moi <Q lang="en">Hello!</Q></Q></LI>
<LI lang="fr">Il dit <Q>Je parle français, et mon frère dit à moi <Q>Bonjour!</Q></Q></LI>
</OL>
</DIV>
I speak English.
I speak English, and my brother saidHello!to me.
Je parle français.Je parle français, et mon frère dit à moi Bonjour!
Je parle français, mais mon frère dit à moi Hello!
Je parle français, et mon frère dit à moiBonjour!
In the first four list items, the Q elements all inherit their lang="xx" attribute from the ancestor element which has the lang="xx" attribute defined, the DIV. This is fine for the English quotes (items 1 and 2), which illustrate correct ("curly") quotation marks on both the main and nested quotes.
However, for the first and second French quotes (items 3 and 4), this is a "mis-inheritance" which should be overruled by the presence of lang="fr" attribute on the first Q element of each list item.
The second French quote (item 4) has the correct French quotation marks on the nested quote because the nested quote inherited the lang="fr" attribute from its parent, the initial Q element, as would be expected given the nested Q element has no language defined.
Items 5 and 6 add the lang="fr" attribute to the LI element. This allows the main quote to inherit the proper French quotation marks in both list items.
However, Item 5, which switches the language of the nested quote to English, again "misinherits" the lang="fr" attribute from its parent (the inital Q element) and the nested quote's own lang="en" attribute is ignored.
Finally, item 6 is the "inverse" of item 4, correctly displaying French quotation marks for both the main and nested quote because the lang="fr" attribute has moved from the Q element itself in item 4 (where it is ignored) to the LI element, where it is inherited by both "unattributed" Q elements in item 6.
lang="xx" attribute to a parent element of any Q element if possible. As illustrated by list item 5, however, this will not work when languages switch in nested quotations.Last updated: 2005-05-21; link to new discussion added and URL to Sander's testcase corrected 2006-01-02.