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

Source filesystem not creating allLocale

Open jeffpascal opened this issue 4 years ago • 1 comments

Hello!

In the documentation, it says to add the graphql inside the page, to get the translation for namespaces.

  query($language: String!) {
    locales: allLocale(
      filter: {ns: {in: ["translation", "about-page"]}, language: {eq: $language}}
    ) {
      edges {
        node {
          ns
          data
          language
        }
      }
    }
  }

Except that when i look inside graphiql i see:

enJson ruJson

not the allLocale i was expecting.

This is the filesystem in the config:

{
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `locale`,
        path: `${__dirname}/locales`,
      }
    },
    

and the folder structure is:

/locales/en

  • common.json
  • about-us.json

/locales/ru

  • common.json
  • about-us.json

jeffpascal avatar Mar 10 '21 19:03 jeffpascal

Fixed it by updating plugin to 1.0.1, it was 0.2 :) .

jeffpascal avatar Mar 11 '21 22:03 jeffpascal