Skip to content

ftdebugger/agrest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Агрэст 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__'"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •