On 26 Apr 2023 10:59:07 GMT, Stefan Ram wrote:
>
> One could write:
> ... my course, Which holds not
> <span class="American">color</span>
> <span class="British">colour</span>
> with the time ...
I'm not sure what "not" means above, but anyway ...
> and offer two different style sheets "American" and "British". Then
> people could choose the language to be used for the display in
> their browsers where they choose a stylesheet.
This is an interesting idea. Your British stylesheet would have
span.American { display:none; }
and your American stylesheet would have
span.British { display:none; }
You don't need to supply any CSS for the "want to show" language,
since display:inline is the default.
But why do it with classes? The "lang" attribute already exists. I'm
too lazy to look up the language codes, but I think they are as
follows:
<span lang="en-US">color</span>
<span lang="en-GB">colour</span>
and then your GB stylesheet would have
span:lang(en-us) { display:none; }
while your US one would have
span:lang(en-gb) { display:none; }
> However, could there be a safe fallback for browsers without CSS?
What do you mean by "fallback"? Presumably having someone read "the
colour color of her eyes" is bad, so the only possible fallback is
one that preselects either the US or the GB style. In that case you
don't really need a method for people to select one of two
stylesheets, bur rather to select the other stylesheet if the default
one is not to their liking.
However, I believe that English speakers understand that there are
spelling variants in different dialects, and they don't find it
troublesome to read them. Why not just specify either <html lang="en-
US"> or <html lang="en-GB"> and then spell everything the correct way
for that variannt?
> BTW: This is a quotation from Shakespeare who, according to my
> sources, actually wrote "color", even though he was British AFAIK!
The -our spellings, I believe I read somewhere, were _added_ in
British English after the US gained its independence. :-)
> PS: I do not want to go through the hassle to prepare two
> different documents when they differ only by a few words.
Understandable. But if you follow my suggestion, you also eliminate
the hassle (less, but still greater than zero) of identifying words
with variant spelling and creating duplicates with two different
wrappers.
--
Stan Brown, Tehachapi, California, USA
https://BrownMath.com/