Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.
/ acyort-i18n Public archive
forked from jeresig/i18n-node-2

acyort i18n module, based on i18n-node-2

License

Notifications You must be signed in to change notification settings

acyortjs/acyort-i18n

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()),
})

About

acyort i18n module, based on i18n-node-2

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%