0.10.0 • Published 4 months ago

babel-plugin-i18next-extract v0.10.0

Weekly downloads
18,197
License
MIT
Repository
github
Last release
4 months ago

Logo

babel-plugin-i18next-extract

License: MIT CI Netlify Status Test Coverage

NPM


babel-plugin-i18next-extract is a Babel Plugin that will traverse your Javascript/Typescript code in order to find i18next translation keys.

Features

  • ✅ Keys extraction in JSONv4 format.
  • ✅ Detection of i18next.t() function calls.
  • ✅ Full react-i18next support.
  • ✅ Plurals support.
  • ✅ Contexts support.
  • ✅ Namespace detection.
  • ✅ Disable extraction on a specific file sections or lines using comment hints.
  • ✅ Overwrite namespaces, plurals and contexts on-the-fly using comment hints.
  • … and more?

Documentation

You can check out the full documentation at i18next-extract.netlify.com.

Quick Start

Installation

yarn add --dev babel-plugin-i18next-extract

# or

npm i --save-dev babel-plugin-i18next-extract

Minimal configuration

If you don't have a babel configuration yet, you can follow the Configure Babel documentation page to get started.

Declare the plugin like any other plugin in your .babelrc and you're good to go:

{
  "plugins": [
    "i18next-extract",
    // […] your other plugins […]
  ]
}

You may want to specify additional configuration options:

{
  "plugins": [
    ["i18next-extract", {"nsSeparator": "~"}],
    // […] your other plugins […]
  ]
}

For an exhaustive list of configuration options, check out the Configuration page.

Once the plugin is setup, you can build your app normally or run Babel through Babel CLI:

yarn run babel -f .babelrc 'src/**/*.{js,jsx,ts,tsx}'

# or

npm run babel -f .babelrc 'src/**/*.{js,jsx,ts,tsx}'

Extracted translations land in the extractedTranslations/ directory by default.

0.10.0

4 months ago

0.9.2

6 months ago

0.9.1

6 months ago

0.9.0-rc

2 years ago

0.9.0-rc.1

2 years ago

0.9.0

2 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.8.1

3 years ago

0.8.0

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.1.0-rc.3

5 years ago

0.1.0-rc.2

5 years ago

0.1.0-rc.1

5 years ago

0.1.0-rc

5 years ago

0.1.0-alpha.3

5 years ago

0.1.0-alpha.2

5 years ago

0.1.0-alpha.1

5 years ago

0.1.0-alpha.0

5 years ago