Needs work
Project:
XML sitemap
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Dec 2025 at 09:52 UTC
Updated:
16 Jan 2026 at 17:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mariatosheva commentedAdded LanguageManagerInterface dependency injection.
All $this->t() calls now explicitly pass the current language via ['langcode' => $langcode].
Added proper HTTP cache headers (Vary: Accept-Language, Cache-Control: no-cache, must-revalidate) to prevent incorrect caching.
Comment #3
mariatosheva commentedComment #4
mariatosheva commentedTranslations use explicit ['langcode' => $langcode] option to ensure correct language in XmlSitemapController.php.
The XSL URL is generated with the correct language prefix based on the sitemap context in XmlSitemapWriter.php.
Each sitemap XML file will have an XSL reference with the correct language prefix (e.g., /en/sitemap.xsl, /fr/sitemap.xsl).
Comment #5
poker10 commentedThanks for reporting this.
It would be great if you can create a MR instead of patches. That is a preffered way of contributing these days and we can also run pipelines on the MR. See: https://www.drupal.org/docs/develop/git/using-gitlab-to-contribute-to-dr...
Does this also affect 2.x branch? If so, we should create MR for 2.x branch first (and then can probably backport the fix to 8.x-1.x, if needed).