tractorcow-farm / silverstripe-fluent

Multi-language translate module for Silverstripe, without having to manage separate site trees.
BSD 3-Clause "New" or "Revised" License
93 stars 111 forks source link

hreflang in Google Sitemap XML if no translation exists #871

Open BrandSven opened 3 months ago

BrandSven commented 3 months ago

Module version(s) affected

7

Description

Let's say a site has 100 pages in a default language, but only 60 of them are translated into a second language.

The Google XML Sitemap will add hreflang entries to the 40 non-translated items. All of them point to the home page of the second language (https://mysite.com/2ndlanguage/).

The correct behaviour would be to omit the hreflang entry in the sitemap item if there is no translation to a page.

How to reproduce

Add a new page in the default language, but don't translate it. Check the Google XML Sitemap entry of that page.

Possible Solution

Omit hreflang if there is no translation

Additional Context

No response

Validations