I am coding a multilingual site and I have following navigation:
<nav id="language">
<ul>
<li><a href="/en/" hreflang="en">en</a></li>
<li><a href="/de/" hreflang="de">de</a></li>
<li>fr</li>
</ul>
</nav>
Can I improve semantics? With Microdata or tags attributes e.g
abbrelementsYou should add
abbr, giving the full language name in the corresponding language:titleattribute foraYou could add a
titleattribute toawith a content like: “Switch to the English translation of this page”heading for
navYou could give this
navsection a heading like “Translations of this page” (for the English page).If you don’t want it to be visible on the page, hide it visually so that it is still read to screenreader users (e.g. with the
clipmethod).(If you provide such a heading, you probably don’t need the
titleattribute onaanymore.)additionally:
linkelement (inhead)For bots, you could link the translations with
linkelements in theheadof your pages: