microapps/gatsby-plugin-react-i18next

How to translate markdown files?

ohmyide opened this issue · 1 comments

How to deal with markdown files in different languages?
Such as: filename.en.md, filename.es.md, filename.de.md

thanks!

You don't.

Since you're translating this file manually (or at least not using the plugin) you need to exclude that pages. In my case I have the blogposts as markdown files like the ones you mentioned

// gatsby-plugin-react-i18next options in gatsby-config.js
pages: [
          {
            matchPath: "/:lang?/blog/:uid",
            getLanguageFromPath: true,
            excludeLanguages: ["es", "en"],
          },
        ],

Then in gatsby-node.js I create the pages using the markdown files in the path I excluded from gatsby-plugin-react-i18next