mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Translate
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user