Alex Rivera | Logout

What is the correct semantics for language switching navigation?

Asked 2013-01-26T21:44:36.587
9

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

Edit
Report

1 Answer

2

you should add a lang and hreflang attribute on the link, with an IETF language tag (bcp47) as the target value, see e.g. the links in wikipedia's article on water to the same item in other languages:

<a lang="de" hreflang="de" title="Wasser" href="//de.wikipedia.org/wiki/Wasser">Deutsch</a>

NB: the lang attribute is not link specific. it specifies the language of the content of the tag (wikipedia puts it also in the <html>- tag and on the <h1> header-tag.), while hreflang specifies the language of the page you are linking to.

answered 2013-01-27T07:29:58.383

Your Answer