From b71c4e137e69bbc03ac03738df6a3fdf6f2ff1e3 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Mon, 28 Sep 2015 15:21:06 -0500 Subject: [PATCH] Translate --- ionic/translation/translate.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/ionic/translation/translate.ts b/ionic/translation/translate.ts index 835433e57d..eaf62fcc03 100644 --- a/ionic/translation/translate.ts +++ b/ionic/translation/translate.ts @@ -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 + * {{ 'Welcome to MyApp' | translate }} + * ``` + */ @Injectable() export class Translate { constructor() {