Documentation

 

Using translation pipes in views

You can use the translate pipe to get your translation values:

{{ key | translate:parameters }}

The parameters are optional. For example:

{{ 'app.home.title' | translate }}

Or with parameter:

{{ 'app.home.welcome' | translate:{ name: 'John' } }}

You can also specify the paramaters in the component:

const profile = {
  name: 'John',
  age: 37
};
{{ 'app.home.welcome' | translate:profile }}

When you use HTML tags in the translation text:

{
  "version": "Application Name<br><strong>Version 1.0.0</strong>"
}

It can be displayed using the innerHTML attribute:

[innerHTML]="'app.version' | translate">