This is a good practice to place this kind of links in head for multilanguage sites:
<head>
<link rel="alternate" hreflang="en" href="/en">
</head>
But, according to an answer to the question Semantic markup for language switcher, language switcher should look something like:
<nav> <h1>Translations of this page</h1> <!-- could be omitted → usability question --> <ul> <li>English</li> <!-- could be omitted → usability question --> <li><a rel="alternate" href="/pl" hreflang="pl" lang="pl">Polski</a></li> <li><a rel="alternate" href="/de" hreflang="de" lang="de">Deutsch</a></li> </ul> </nav>
I've got few semantic markup questions according to that:
Are both of those rules required for SEO? Or, if I've got language switcher on my site, links in
head
are not needed anymore?Let's say that I'm on the page:
example.com/pl/kontakt
. Should translation links insidehead
(ornav
) point to:example.com/en/contact
(direct translation), or onlyexample.com/en
(English mainpage)?What about more specific situation:
example.com/pl/aktualnosci/id/101
. 'aktualnosci' means news. As you can see not all the newses can be translated into every language. And it is sometimes hard to predict the perfect translation URL, based on only parameters. So the question is: where should the translationlink
(ornav
) point for this URL:example.com/pl/artykul/id/101
, when:- We are not sure if this resource is translated?
- We don't exactly know the translation URL?
- Resource is for 100% not translated?
I hope my question is clear. But I will put one more example: Someone is on the page example.com/en/news/2015/03/02/stackoverflow-rules
, and this news is not translated to Polish. Is it a mistake to put:
<link rel="alternate" hreflang="pl" href="/pl/aktualnosci">
as a translation? Of course this page is not a translation, but only for example a list of all translated newses.
As for me semantically it is a mistake, as this is NOT a translation, but from UX side, it is great, because it points to the nearest translated resource and make life easier for the user.