A customized gatsby-plugin-intl package with slug translation support.
- Original package: wiziple/gatsby-plugin-intl
- Package with slug support: Jno21/gatsby-plugin-intl
- Install the package:
npm install --save https://github.com/bartosjiri/gatsby-plugin-intl
- Add the plugin to the
gatsby-config.js
file:plugins: [ { resolve: `gatsby-plugin-intl`, options: { path: `${__dirname}/src/intl`, languages: [`en`, `cs`], defaultLanguage: `cs`, redirect: true, }, }, ]
- Create a locale config file for each language (ex.
/src/intl/cs.json
) including translations for all pages:{ "pages": { "404": "not-found", "index": "index", "page-2": "stranka-2", "subpage/page-3": "podstranka/stranka-3" } }
- Continue using other features from the original package.