2.1.0 • Published 8 years ago

agrest v2.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Агрэст Build Status

Якім будзе тваё першае слова на роднай мове?

Simply stupid i18n library

Installation

npm install --save agrest

Usage

import {agrest} from 'agrest';
import en from 'agrest/lib/plural/en';
import ru from 'agrest/lib/plural/ru';

$.getJSON('/assets/i18n/en.json').then(translations => {
    window.translate = agrest(translations, {
        language: 'en',
        plurals: {en, ru}
    });
    
    translate('simple_key');
    translate('nested.key');
    translate('plural_key', {count: 1});
    translate('placeholder', {value: "some value"});
})

// en.json

{
    "simple_key": "Simple value",
    "nested": {
        "key": "Nested value"
    },
    "plural_key": [
        "__count__ key",
        "__count__ keys"
    ],
    "placeholder": "And here come '__value__'"
}
2.1.0

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.1

8 years ago

1.0.0

9 years ago