Skip to content

Releases: i18next/i18next-parser

9.0.1

08 Aug 12:41
Compare
Choose a tag to compare

8.0.0

08 May 03:16
Compare
Choose a tag to compare
  • BREAKING: Drop support for Node 14
  • Add support for Node 20

7.0.0

11 Nov 02:48
Compare
Choose a tag to compare
  • BREAKING: change the API for defaultValue. Deprecate skipDefaultValues and useKeysAsDefaultValues options. #676
  • Add support for shouldUnescape option in jsx-lexer #678
  • Add support for .ts, .json and .yaml config #673
  • Update dependencies

Migrating from 6.x to 7.x

he API to manage what default value is being used was getting too complicated. This version simplifies the API by deprecating the skipDefaultValues and useKeysAsDefaultValues options and adding a value argument when the defaultValue option is used as a function. Here are couple example of how it can be used:

To replace skipDefaultValue, make the following change:

// 5.x.x
{
  skipDefaultValues: true
}

// 6.x.x
{
  defaultValue: function (locale, namespace, key, value) {
    return '';
  }
}

To replace useKeysAsDefaultValues, make the following change:

// 5.x.x
{
  useKeysAsDefaultValues: true
}

// 6.x.x
{
  defaultValue: function (locale, namespace, key, value) {
    return key;
  }
}

And now you have complete control over the logic:

// 6.x.x
{
  defaultValue: function (locale, namespace, key, value) {
    if (locale === 'fr') {
      return '';
    }
    return value || key;
  }
}

6.0.0

13 Mar 04:13
Compare
Choose a tag to compare
  • BREAKING: Drop support for Node 12, 13, 15.
  • BREAKING: This package is now pure ESM
  • Update dependencies

4.0.1

17 May 05:08
Compare
Choose a tag to compare

Drop support for Node 10

3.0.0

08 Aug 00:12
Compare
Choose a tag to compare

We drop the reactNamespace option along with improvements to how it is managed. Thanks to @vincaslt

You can also check the migration guide and changelog for more details.

We are out of beta!

17 Sep 18:23
Compare
Choose a tag to compare

1.x has been in beta for a good while. It is a deep rewrite of this package that solves many issues, the main one being that it was slowly becoming unmaintainable. The migration from 0.x contains all the breaking changes.

You can still find the old 0.x documentation on its dedicated branch.

1.0.0-beta29

17 Sep 18:27
Compare
Choose a tag to compare
1.0.0-beta29 Pre-release
Pre-release

This release introduce breaking changes. If you rely on advanced Javascript features, you might need to include manually the plugins you need. The point is to limit the number of dependencies of this project.

If you used to do something like:

acorn: {
  sourceType: 'module', 
  ecmaVersion: 9, // forward compatibility
  plugins: {
    es7: true, // some es7 parsing that's not yet in acorn (decorators)
    stage3: true // load some stage3 configs not yet in a version
  }
}

You now must include the dependencies (via npm or yarn) and change the config file to:

// npm install or yarn add what you need and require them:
const injectAcornStaticClassPropertyInitializer = require('acorn-static-class-property-initializer/inject');
const injectAcornStage3 = require('acorn-stage3/inject');
const injectAcornEs7 = require('acorn-es7');

// ...
  js: [{
    lexer: 'JavascriptLexer'
    functions: ['t'], // Array of functions to match

    // acorn config (for more information on the acorn options, see here: https://github.com/acornjs/acorn#main-parser)
    acorn: {
      injectors: [
          injectAcornStaticClassPropertyInitializer,
          injectAcornStage3,
          injectAcornEs7,
        ],
      plugins: {
        // The presence of these plugin options is important -
        // without them, the plugins will be available but not
        // enabled.
        staticClassPropertyInitializer: true,
        stage3: true,
        es7: true,
      }
    }
  }],
// ...

All the options are well documented in the README.

1.0.0-beta15

30 May 00:50
Compare
Choose a tag to compare
1.0.0-beta15 Pre-release
Pre-release

Add a Broccoli plugin

1.0.0-beta14

27 May 22:09
Compare
Choose a tag to compare
1.0.0-beta14 Pre-release
Pre-release
  • Improve JSX lexer (thanks to @MynockSpit)
  • Move HTML lexer to cheerio (closes #94)