one of the things HTML is good at is that it supports at least some semantics, for example for using quoted text by using the <q>
element, if you are using a decent browser (specifically, not IE). you can even nest
and they will display differently. that's how good HTML can actually be when used correctly (and when used with a non-crappy browser).quotes
the problem is that different languages have different rules for using and nesting quotes. so while decent browsers support quotes, they don't support them in a language-sensitive way. consider the following test file for built-in support for language sensitive quotes:
<p>Some <q>language-neutral <q>quotes</q></q>.</p>
<p lang="en" xml:lang="en">Some <q>English <q>quotes</q></q>.</p>
<p lang="en-US" xml:lang="en-US">Some <q>U.S. English <q>quotes</q></q>.</p>
<p lang="en-GB" xml:lang="en-GB">Some <q>U.K. English <q>quotes</q></q>.</p>
<p lang="de" xml:lang="de">Some <q>German <q>quotes</q></q>.</p>
<p lang="de-CH" xml:lang="de-CH">Some <q>Swiss German <q>quotes</q></q>.</p>
<p lang="de-AT" xml:lang="de-AT">Some <q>Austrian German <q>quotes</q></q>.</p>
<p lang="fr" xml:lang="fr">Some <q>French <q>quotes</q></q>.</p>
<p lang="fr-CH" xml:lang="fr-CH">Some <q>Swiss French <q>quotes</q></q>.</p>
none of the browsers i tested actually display the quotes as they should be displayed; firefox and opera at least support nested quotes by using different quotation marks; safari is too stupid to properly handle nested quotes; IE is too stupid to even support quotes at all.
this means that the browers' built-in stylesheets apparently are not very sophisticated. correct language-sensitive quote formatting could be easily implemented by CSS code like this:
q { quotes: '"' '"' "'" "'" }
q:lang(en) { quotes: '“' '”' '‘' '’' }
q:lang(en-US) { quotes: '“' '”' '‘' '’' }
q:lang(en-GB) { quotes: '‘' '’' '“' '”' }
q:lang(de) { quotes: '„' '“' '‚' '‘' }
q:lang(de-CH) { quotes: '«' '»' '‹' '›' }
q:lang(fr) { quotes: '«' '»' '“' '”' }
q:lang(fr-CH) { quotes: '«' '»' '‹' '›' }
and if you look at the above HTML using this improved CSS for quotes, then firefox and opera are getting it right. both browsers even understand that
is a variant of de-AT
and use the de
rule as fallback, because there is no explicit de
rule. that's pretty neat. but safari still only supports one kind of quotes; is WebKit really that bad?de-AT
all of this simply translates to: if you want proper internationalization for quotation marks, don't trust the browsers. if you absolutely need quotation marks to be displayed (IE simply ignores <q>
elements), you might want to insert them using scripting (don't insert them as text!), because IE once again does not implement standards.
Comments
You can follow this conversation by subscribing to the comment feed for this post.