Re: language-shift logical tag?

Michael Hamm <msh210@is7.nyu.edu> wrote:

> On Thu, 30 Dec 1999, Nir Dagan wrote, in part:
> > HTML4.0 and later have a lang attribute that may be applied to most
> > elements: http://www.w3.org/TR/html401/struct/dirlang.html
> 
> I am aware of that. It would make sense for lang to be a tag. (In fact, it
> used to be a tag, at least in the never-official HTML3.)

There's already an answer to your question:

    http://lists.w3.org/Archives/Public/www-html/1998Sep/0048

which was a response to your original question.

SPAN was originally introduced by RFC 2070, a.k.a. "Internationalization
of HTML", to carry attributes like "lang" and "dir", without attaching
any other meaning.  From section 4.2.2 of RFC 2070:

  4.2.2. List of entities, elements, and attributes

     First, a generic container is needed to carry the LANG and DIR (see
     below) attributes in cases where no other element is appropriate; the
     SPAN element is introduced for that purpose.

It wouldn't make sense for lang to be a tag.  Almost everything in
documents is in some language, so saying "LANG element's content is
in some language" doesn't mean much by itself.  To be useful, you need
a mechanism to specify particular language.

So, even if we have the LANG element, we also need the "lang" attribute.
In fact, HTML 3.0 had the "lang" attribute.  I don't see any advantage
to have

  <LANG lang="fr">Internationalisation du langage de balisage hypertexte</LANG>

rather than

  <SPAN lang="fr">Internationalisation du langage de balisage hypertexte</SPAN>

or any other elements with lang attribute.

In <http://lists.w3.org/Archives/Public/www-html/1998Sep/0047>, you wrote:

> I wanted a tag that
> itself would specify language change, so that the browser developers can
> then decide to underscore or boldface or italicize or do nothing to the
> text within the tag. (This is as distinct from <i lang="bl">blah</i>,
> which specifies italics.)

If you want to change style according to language change, CSS2 has
introduced selectors for that particular purpose - namely, ':lang'
pseudo-class and '|=' operator.  For example, if you want to italicize
all french texts in an HTML document, you may write either

  :lang(fr) { font-style: italic }

or

  *[lang|="fr"] { font-style: italic }

in your style sheets.  See "5.11.4 The language pseudo-class: :lang" and
"5.8 Attribute selectors" of the CSS2 Specification for more details.

Regards,
-- 
Masayasu Ishikawa / mimasa@w3.org
W3C - World Wide Web Consortium

Received on Thursday, 30 December 1999 22:01:16 UTC