Releases: mashpie/i18n-node
Releases · mashpie/i18n-node
0.11.1 - Maintenance
Fixed
- dependabot bumbed minimist
Minimist is a sub-dependency of mocha
and messageformat
:
$ npm ls minimist
i18n@0.11.0
├─┬ messageformat@2.3.0
│ └─┬ make-plural@4.3.0
│ └── minimist@1.2.5
└─┬ mocha@7.1.2
└─┬ mkdirp@0.5.5
└── minimist@1.2.5 deduped
0.11.0 - Feature Release
0.10.0 - Feature Release
Thanks to @einfallstoll i18n got much more developer friendly by adding two extra configuration options for working with translation files catalogs.
Added
- Adds support for priming i18n with static catalogs (PR #432)
- Adds support for custom callback/hook on missing translations thru
missingKeyFn
option ℗ #433 )
Examples
staticCatalog
Instead of letting i18n load translations from a given directory you may now pass your js object right on configuration, ie:
// DEMO: quick add yaml support on your own
const yaml = require('js-yaml');
const fs = require('fs');
// configure and load translations from different locations
i18n.configure({
staticCatalog: {
de: require('../../locales/de.json'),
en: require('../../locales/wired-en-filename.js'),
fr: yaml.safeLoad(fs.readFileSync('../../locales/yaml/fr/server.yml', 'utf8'));
},
defaultLocale: 'de'
})
This opens up for a ton of possible ways to handle translations in your very own desired way. But be warned: "Great power comes with great responsibility".
missingKeyFn
Want to get a warning on missing translations? Add missing translations with an indicator? Or even want to try an external service (like deepl.com) to provide an automated translated proposal of a missing phrase?
i18n.configure({
missingKeyFn(locale, value) {
console.warn(`missing translation of "${value}" in [${locale}]!`)
return `${value}-[${locale}]`;
},
defaultLocale: 'de'
})
0.9.1 - Housekeeping
Fixed
- Catch race condition in parallel fs tasks (PR #431)
- Update packages, remove unused
url
0.9.0 - Feature Release
Added
- Support for floats (as
number
orstring
) in__n()
(#305 )
0.8.5 - General Maintenance
0.8.4 - General Maintenance
Added
- Support for empty strings in translation files (#261)
- Greenkeeper integration (#414)
- Tidelift integration Learn more.
- Travis OS X build
Fixed
- Security audit, package version updates & upgrades (#414)
- Consistant case comparison (#128, #255)
- Typos, CI, Testing (#330, #273, #373, #395, #411)
Removed
- AppVeyor integration (will be replaced by Travis Windows Builds)