- From: Thomas Hurst <tom.hurst@clara.net>
- Date: Sat, 16 Mar 2002 23:38:52 +0000
- To: www-style@w3.org
* Ineke van der Maat (inekemaa@xs4all.nl) wrote:
> Here is the best way to mark up every change of language???
<div xml:lang="fr">
<h2>...</h2>
<p>...</p>
<table>..</table>
</div>
Obviously if you switch between languages a lot you pay the price, but
it's not as if you can't set up a macro in your editor to do it for you
(and if you can't, might I suggest you get a better one (vim!) :)
> Yes my concern is legacy browsers, but I am convinced that for
> text-only browsers this is the nicest solution or la plus belle
> solution??
Text only browsers don't (yet) support CSS, and both these will come out
the same:
> <p><em class="en" xml:lang="en">Jean put dire comment on tape</p>
> <p><em class="fr" xml:lang="fr">Jean put dire comment on tape</p>
I think it's probably best to explicitly mention the language, so
it keeps it's meaning even after, say, conversion to plaintext, or
displayed on a mobile device or a browser that lacks CSS support:
<h4 class="langName">English</h4>
<p xml:lang="en">Jean put dire comment on tape</p>
<h4 class="langName">French</h4>
<p xml:lang="fr">Jean put dire comment on tape</p>
If you still want the languages to be displayed in colour only, you can
always do:
/* Best use a CSS 2 selector so CSS 1 browsers don't turn off this
* information but leave the text the same
*/
*[class="langName"] {
display: none;
}
*[xml:lang="fr"] { .. }
*[xml:lang="en"] { .. }
Although I'm not sure about that namespaced lang attribute selector. In
CSS 3 you'd use :lang(en), and want to use something CSS3 specific to
match the <h4> *grumble*
Since we come across these kinds of things a lot; where one rule relies
on another (you don't want to turn off the langName unless you can also
change the individual language sections); I wonder if it would make
sense to provide:
@critical {
/* rules where all must be ok or none are applied */
.langName { display: none; }
:lang(en):before { content: "English";color: black; }
:lang(fr):before { content: "French";color: red; }
}
or so.
--
Thomas 'Freaky' Hurst - freaky@aagh.net - http://www.aagh.net/
-
The opposite of a profound truth may well be another profound truth.
-- Bohr
Received on Saturday, 16 March 2002 18:38:57 UTC