1.0.0 • Published 6 years ago

acyort-i18n v1.0.0

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

acyort-i18n

Build Status

Based on i18n-node-2

Features

Add "zero" support

{
    'cat': {
        'zero': 'no cats',
        'one': 'one cat',
        'other': '%d cats'
    }
}

i18n.__n('cat', 0)  // 'no cats'
i18n.__n('cat', 1)  // 'one cat'
i18n.__n('cat', 8)  // '8 cats'

Usage

const i18n = {}
const directory = 'path/to/language.yml'
const ymal = require('yamljs')
const language = 'en'

new I18n({
  locales: [language],
  registered: i18n,
  directory,
  extension: '.yml',
  parse: data => yaml.parse(data.toString()),
})
1.0.0

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

7 years ago

0.1.0

7 years ago