Hi all, I have a multilanguage domain site (IT (default), EN, FR, DE, ES) and I have created a sitemap.xml for every languages.
Now I have a problem: the number of the link is double for the "derivated" language.

Italian -> 282 links

Spanish -> 553 links

German -> 553 links

French -> 553 links

English -> 561 links

Why italian (default language) have 282 links but Spanish, German and French have 553 links ? And English 561 links ?

In my site there is a 1:1 corrispondence for every page (the same page is present in every languages). I can think that could be a 5-6 link/page difference, but not the double.

For test I have download german sitemap pages and in the third page the german url finish and the italian starts. Why ?
I have tried with french: same result. Spanish: same result.

Tnx.

Comments

unityweb’s picture

Same here; did you find a solution ?

jamonation’s picture

Confirming this behaviour as well, subscribing.

jamonation’s picture

As it turns out, this depends on how the il8n module is configured. Take a look at /admin/settings/language/i18n - specifically, this issue arises when using 'mixed' mode.

jamonation’s picture

Another update for anyone encountering this issue, if you're using drush to generate the sitemap files, it is really easy to automate switching languages and then switching back. For example:

drush @sitealias vset i18n_selection_mode simple -y
drush @sitealias xmlsitemap-regenerate
drush @sitealias vset i18n_selection_mode mixed -y

Otherwise, you can define a custom override in a module for the xmlsitemap_i18n_query_xmlsitemap_generate_alter() function, specifically copy the function and edit the mixed case $query to use (note the second empty '':

$query['WHERE'] .= " AND x.language IN ('%s', '', '')";

See http://drupalcode.org/project/xmlsitemap.git/blob/4f61768554cca98a3fa35c... for the entire function.

Not sure if this is a bug or the intended outcome of the mixed case switch though. Since the site I'm working with has 1:1 English & French pages, things are a bit more flexible in terms of switching il8n behaviours.