Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support i18n locales options #262

Open
tonqa opened this issue Aug 7, 2022 · 0 comments
Open

Support i18n locales options #262

tonqa opened this issue Aug 7, 2022 · 0 comments

Comments

@tonqa
Copy link

tonqa commented Aug 7, 2022

Currently, I use following config in nuxt.config.js:

  i18n: {
    parsePages: false,
    locales: [
      {
        code: "en",
        iso: "en-US",
        name: "English",
        file: "en.json",
      },
      {
        code: "de",
        iso: "de-DE",
        name: "Deutsch",
        file: "de.json",
      },
    ],
    pages: {
      poetry: {
        en: "/poetry",
        de: "/poesie",
      },
      reports: {
        en: "/reports",
        de: "/berichte",
      },
    },
    strategy: "prefix_and_default",
    defaultLocale: "en",
    vueI18n: {
      baseUrl: "https://eglador.de",
      fallbackLocale: "en",
      silentFallbackWarn: true,
    },
    detectBrowserLanguage: {
      useCookie: true,
      cookieKey: "lang",
      redirectOn: "root",
      alwaysRedirect: true,
    },
    vueI18nLoader: true,
    langDir: "~/locales/",
  },

It seems to me that the sitemap module is slightly confused by the structured locales property. It generates something like this:

    <url>
        <loc>https://mydomain.de/</loc>
        <lastmod>2022-08-07T17:25:50.816Z</lastmod>
        <changefreq>weekly</changefreq>
        <priority>1.0</priority>
        <xhtml:link rel="alternate" hreflang="de" href="https://mydomain.de/de" />
        <xhtml:link rel="alternate" hreflang="en" href="https://mydomain.de/en" />
        <xhtml:link rel="alternate" hreflang="x-default" href="https://mydomain.de/" />
    </url>

It states three alternative xhtml:link elements. Instead it should state only the en locale as a default without the non existing /en/* pathes and the de locale as an alternative to this with the /de/* pathes. Please make that these default options are supported, such that I can start to use your module again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant