angular2-i18n
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

angular2-i18n

Simple i18n service and pipe for angular2

Installation

First you need to install the npm module:

npm install angular2-i18n --save

Usage

Service:

let lang = {
        defaultLang: 'en',
        lang: {
            "true": {
                en: "True",
                es: "Verdadero"
            },
            "false": {
                en: "False",
                es: "Falso"
            },
        }
    };
    
i18n:I18nService = new I18nService();
i18n.init(lang);
 
let text:string = i18n.translate("true");
 

Pipe:

{{ "true" | i18n }}

Readme

Keywords

Package Sidebar

Install

npm i angular2-i18n

Weekly Downloads

2

Version

1.0.2

License

MIT

Last publish

Collaborators

  • gonzalo123