Translate

This commit is contained in:
Max Lynch
2015-09-28 15:21:06 -05:00
parent 72658bd970
commit b71c4e137e

View File

@@ -1,5 +1,29 @@
import {Injectable} from 'angular2/angular2';
/**
* Provide multi-language and i18n support in your app. Translate works by
* mapping full strings to language translated ones. That means that you don't need
* to provide strings for your default language, just new languages.
*
* @usage
* ```js
* Translate.translations({
* 'de': {
* 'Welcome to MyApp': 'Willkommen auf'
* }
* })
*
* Changing the default language:
*
* Translate.setLanguage('de');
* ```
*
* Usage in a template:
*
* ```js
* <span>{{ 'Welcome to MyApp' | translate }}
* ```
*/
@Injectable()
export class Translate {
constructor() {