Skip to content

Commit

Permalink
Bump to 7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
karellm committed Nov 11, 2022
1 parent 7d852be commit c1f2f14
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,12 @@
# Changelog

# 7.0.0

- 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

# 6.6.0

- Support custom yaml output options #626
Expand Down
52 changes: 52 additions & 0 deletions docs/migration.md
@@ -1,3 +1,55 @@
# Migrating from `6.x` to `7.x`

## Breaking changes

- The 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:

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

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

To replace `useKeysAsDefaultValues`, make the following change:

```js
// 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:

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

# Migrating from `5.x` to `6.x`

## Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "i18next-parser",
"description": "Command Line tool for i18next",
"version": "6.6.0",
"version": "7.0.0",
"type": "module",
"license": "MIT",
"author": "Karel Ledru",
Expand Down

0 comments on commit c1f2f14

Please sign in to comment.