nuxt-modules / sitemap

Powerfully flexible XML Sitemaps that integrate seamlessly, for Nuxt.
https://nuxtseo.com/sitemap
312 stars 28 forks source link

help: _i18nTransform not translate path defined in @nuxt/i18n pages configuration #363

Open fedetorre opened 6 days ago

fedetorre commented 6 days ago

šŸ“š What are you trying to do?

Good morning,

I am try to generate a dynamic sitemap from a list of items. In my project I use @nuxt/i18n for path translations. I have the following configuration of the i18n module:

i18n: { baseUrl: 'https://mydomain.com', locales, defaultLocale: 'en', strategy: 'prefix', detectBrowserLanguage: { useCookie: true, cookieKey: 'i18n_redirected', redirectOn: 'root', }, customRoutes: 'config', // disable custom route with page components pages: { 'terms-and-conditions': { en: 'terms-and-conditions', it: 'termini-e-condizioni', } }, },

If I use the _i18nTransform option for the sitemap generation I'm expecting that the sitemap will have an entry in the en version with /en/terms-and-conditions loc and one in the italian sitemap with the loc /it/termini-e-condizioni but the generated sitemaps has both the terms-and-conditions path at the end without translation. It seems that the _i18nTransform option only append the language prefix in the beginning part of the url. Is it true or I have to configure something else?

Thanks!

šŸ” What have you tried?

No response

ā„¹ļø Additional context

No response

harlan-zw commented 6 days ago

The _i18nTransform config does not support the i18n pages config, I'd suggest having these as a static file if possible. This config should only be needed for dynamic data.