Releases: i18next/i18next-parser
9.0.1
8.0.0
7.0.0
- BREAKING: change the API for
defaultValue
. DeprecateskipDefaultValues
anduseKeysAsDefaultValues
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
4.0.1
3.0.0
We are out of beta!
1.0.0-beta29
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
Add a Broccoli plugin
1.0.0-beta14
- Improve JSX lexer (thanks to @MynockSpit)
- Move HTML lexer to cheerio (closes #94)