Skip to content

Releases: mashpie/i18n-node

0.11.1 - Maintenance

16 Aug 14:26
Compare
Choose a tag to compare

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

03 Aug 20:27
Compare
Choose a tag to compare

Added

  • Fallbacks can use wildcards (#361) by PR #362
  • New mustache options to tweak tags and/or disable mustache parsing (#436)

Fixed

  • Mitigated Uncaught Exception on malformed query param (#356, #422) by PR #442
  • Use of single pipe character should not be interpreted as range (#274, #388). Fixed by PR #435

0.10.0 - Feature Release

24 May 15:35
Compare
Choose a tag to compare

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

03 May 10:17
Compare
Choose a tag to compare

Fixed

  • Catch race condition in parallel fs tasks (PR #431)
  • Update packages, remove unused url

0.9.0 - Feature Release

17 Apr 10:02
Compare
Choose a tag to compare

Added

  • Support for floats (as number or string) in __n() (#305 )

0.8.5 - General Maintenance

26 Jan 15:56
Compare
Choose a tag to compare

Added

  • PR #425 added support for WHATWG URL API urls

Fixed

  • PR #426 upgraded mocha 7.0.1
  • PR #420 fixes crashing on missing translations files (#419)

0.8.4 - General Maintenance

24 Oct 09:37
Compare
Choose a tag to compare

Added

  • Support for empty strings in translation files (#261)
  • Greenkeeper integration (#414)
  • Tidelift integration Learn more.
  • Travis OS X build

Fixed

Removed

  • AppVeyor integration (will be replaced by Travis Windows Builds)

0.8.3 - General Maintenance

24 Oct 08:35
Compare
Choose a tag to compare

Fixes

  • ObjectNotation: Delimiter issues (#235)
  • Plurals support regions ("en-US", "de-DE") (#231, #245)
  • Binds to objects missing headers attribute (#244)