Suppose I'm writing an article in HTML. The language of the article is Swedish, so I have <html lang="sv">
. Now I want to mark up the abbreviation properly in following text:
HTML kan användas till mycket.
To this end, I first do
<abbr title="HyperText Markup Language">HTML</abbr> kan användas till mycket.
This alone is not good enough, however, because the language of the title
attribute is Swedish (sv
). Besides being a theoretical problem, this will make screen readers pronounce the title in a highly awkward way. To remedy this, I could do
<abbr title="HyperText Markup Language" lang="en">HTML</abbr> kan användas
till mycket.
This is even worse, though, since now the abbreviation 'HTML' will be read in Enligsh instead of Swedish [so from a Swedish point of view, it will sound like "ejtsch-ti-emm-ell" instead of "hå-te-emm-ell"].
Hence, the abbreviation, or the text contents of the abbr
node, should be in Swedish, but the title
attribute should be in English. What is the preferred (HTML5) way of marking this up? Is it
<abbr title="HyperText Markup Language" lang="en">
<span lang="sv">HTML</span>
</abbr> kan användas till mycket.
?
acronym
is obsolete; you useabbr
for all abbreviations today (I just read the HTML5 spec from top to bottom). – Alta