@wapps/gatsby-plugin-lingui

Gatsby plugin that provides i18n support

Usage no npm install needed!

<script type="module">
  import wappsGatsbyPluginLingui from 'https://cdn.skypack.dev/@wapps/gatsby-plugin-lingui';
</script>

README

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