1.0.1 • Published 4 years ago

@neg4n/si18n v1.0.1

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

si18n

very simple internationalization library for node.js

npm install @neg4n/si18n --save

How to use?

  1. Create directory where translations will be located.
    Lets assume we name it i18n
  2. Init Si18n:

    const Si18n = require('@neg4n/si18n').Si18n
    const Path = require('path')
    
    const i18n = new Si18n(Path.join(__dirname, 'i18n'))
  3. Everything's done! Now you can access translations by:

  • Creating i18n/en.yml:
sample:
  nested:
    translation: "yup..."
  • Printing the value:
  console.log(i18n.get('en', 'sample.nested.translation'))
  // output: 'yup...'
1.0.1

4 years ago

1.0.0

4 years ago