Skip to content

0.15.0 - Feature

Latest
Compare
Choose a tag to compare
@mashpie mashpie released this 19 May 10:00
· 22 commits to master since this release

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