prestaconcept/PrestaSitemapBundle

Add default locale as hreflang when using alternate option

taylankasap opened this issue · 2 comments

This code should be removed:

if ($alternate === $locale) {
continue; // avoid re-adding default route
}

Reason

Both from Google docs:

Each element must have a child element <xhtml:link rel="alternate" hreflang="supported_language-code"> that lists every alternate version of the page, including itself.

Each language version must list itself as well as all other language versions.

I can open PR if that's okay.

Hu @taylankasap :)

Thank you for reporting this enhancement.
Looks like you are right, regarding the doc you provided.

A PR would be nice. Will you be OK to add some tests too ?

Released as of v2.5.0