gatsby-plugin-react-i18next icon indicating copy to clipboard operation
gatsby-plugin-react-i18next copied to clipboard

Pages without any language slug not needed

Open bitfella opened this issue 4 years ago • 0 comments

Hi, I was testing this plugin and I realized that pages are generated not only for the defined languages, but also default pages that don't contain any language slug.

For example, if I create a page named test.js and configure the plugin as it follows:

{
    resolve: `gatsby-source-filesystem`,
    options: {
        path: `${__dirname}/locales`,
        name: `locale`
    }
},
{
    resolve: `gatsby-plugin-react-i18next`,
    options: {
        localeJsonSourceName: `locale`,
        languages: [`it`, `en`],
        defaultLanguage: `en`,
        generateDefaultLanguagePage: true,
        siteUrl: process.env.GATSBY_SITE_URL,
    }
},

I get the following pages/uris:

  • /it/test
  • /en/test
  • /test that redirects to /en/test and is not desired

Is this behaviour intentional? Am I missing something? In my view of things and following the best practices on the SEO side, it would make sense to generate only the pages containing the required language slugs. Is this something I can achieve through this plugin's settings?

Thanks!

bitfella avatar Jul 01 '21 14:07 bitfella