rans>Skip to main content
Community Plugin
View plugin on GitHub
See starters using this

gatsby-plugin-lingui

Gatsby plugin that provides i18n support.

Installation

yarn add @wapps/gatsby-plugin-lingui
# npm install --save @wapps/gatsby-plugin-lingui

Usage

Edit gatsby-config.js

module.exports = {
  plugins: [
    {
      resolve: `@wapps/gatsby-plugin-lingui`,
      options: {
        // Add any options here
      },
    },
  ],
}

Options

You can pass options to the plugin:

  • availableLngs (Array [required])
  • fallbackLng (String [required])
  • siteUrl (String [optional])

For example:

options: {
  availableLngs: ['en', 'de'],
  fallbackLng: 'en',
  siteUrl: 'https://www.example.com/',
}

Starters

gatsby-starter-lingui

Demo Source

  • lingui integration
  • automatic browser-language detection and redirection
  • language switcher
  • hreflang

License

MIT

Docs
Tutorials
Plugins
Blog
Showcase