Skip to content

A customized gatsby-plugin-intl package with slug translation support

Notifications You must be signed in to change notification settings

bartosjiri/gatsby-plugin-intl

 
 

Repository files navigation

gatsby-plugin-intl

A customized gatsby-plugin-intl package with slug translation support.

Repositories

Installation

  1. Install the package:
    npm install --save https://github.com/bartosjiri/gatsby-plugin-intl
    
  2. 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,
        },
      },
    ]
    

Usage

  1. 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"
      }
    }
    
  2. Continue using other features from the original package.

About

A customized gatsby-plugin-intl package with slug translation support

Topics

Resources

Stars

Watchers

Forks

Languages

  • JavaScript 100.0%