i18n for angular2
JavaScript TypeScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
tests
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
karma-test-shim.js
karma.conf.js
make.js
package.json
tsconfig.json
typings.json

README.md

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 }}