1.3.3 • Published 6 years ago

ml-i18n.js v1.3.3

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

i18n.js

Tool to transform json key-value format to a translate function

GitHub license npm Commitizen friendly Standard Version

Installation

$ npm install ml-i18n.js

Usage:

$ i18n.js --input './source/**/*.json' --output './target'

Input Format

Input json file for keys and translations for one language

[
  {
    "key": "some.key",
    "value": "translation"
  }
]

Output Format

Output js file for keys and translations for one language

const i18n = {
  "some.key": (p) => "translation"
}
export function translate(key, params) {
  const fn = i18n[key];
  return fn ? fn(params) : key;
}
1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago