Releases: mashpie/i18n-node
0.15.0 - Feature
Added
New parser
configuration option allows to change the default JSON
parser to any other parser with same signature, ie:
const YAML = require('yaml')
/**
* JSON.stringify() -> YAML.stringify()
* JSON.parse() -> YAML.parse()
*/
i18n.configure({
extension: '.yml',
parser: YAML
})
replaces JSON with YAML, so locale files will now format as yaml files.
See https://github.com/mashpie/i18n-node#some-words-on-parser-option and https://github.com/mashpie/i18n-node/blob/master/test/i18n.configureParser.js
Kudos to @mathiashsteffensen for providing the PR #488
0.14.2 - Bugfix
Fixed
Fixes #493 - using i18n with a combination of retry and sync settings lead to a 'Maximum call stack size exceeded' exception due to an infinite loop while writing phrases to all locale files.
const i18n = new I18n({
// [...]
retryInDefaultLocale: true,
syncFiles: true,
})
0.14.1 - Maintenance
Fixed
- upgrade all dev dependencies without breaking changes
- upgrade all dependencies without breaking changes
This also updates to mocha 9.2.0 (mochajs/mocha#4814) which fixes GHSA-qrpm-p2h7-hrv2
0.14.0 - Upgrade
0.13.4 - Maintenance
0.13.3 - Maintenance
Fixed
- upgrade transitive dev dependency of eslint, mocha, zombie to lodash@4.17.21
- upgrade transitive dev dependency of zombie to url-parse@1.5.1
- upgrade transitive dev dependency of eslint-plugin-import to hosted-git-info@2.8.9
0.13.2 - Maintenance
Fixed
- moved devDeps from dependencies to devDependencies #446
- removed unused packages from all dependencies
0.13.1 - Hotfix
Fixed
- npx npm-force-resolutions failed #445
Details
A preinstall script was added to force resolving specific versions of lodash and ajv. Those are sub-dependencies of zombie and its packages. Zombie is devDependency of i18n. But zombie still refers to older versions reported to vulnerable - so I decided to force fixed versions.
Of course that preinstall
should count on any npm install i18n
, it's renamed to force-resolutions
so I can still resolve audit issues in dev while also supporting clean installs.
"scripts": {
"preinstall": "npx npm-force-resolutions"
}
now reads as
"scripts": {
"force-resolutions": "npx npm-force-resolutions"
}
And doesn't get triggered by npm install
.
0.13.0 - Feature Release
0.12.0 - Feature Release
Added
- backward compatible default to singleton with
const i18n = require('i18n')
- create an instance of i18n by
const i18n = new I18n()
Example:
/**
* require I18n with capital I as constructor
*/
const { I18n } = require("i18n");
/**
* create a new instance with it's configuration
*/
const i18n = new I18n({
locales:['en', 'de'],
directory: __dirname + '/locales'
});