Documentation

 

Using attribute directive in views

You can use the translate attribute directive to get your translated texts:

<p translate="key" [translateParams]="parameters"></p>

The parameters are optional. For example:

<p translate="app.help.install"></p>

Or with parameter:

<p translate="app.home.welcome" [translateParams]="{ name: 'John' }"></p>

You can also specify paramaters in the component:

const profile = {
  name: 'John',
  age: 37
};
<p translate="app.home.welcome" [translateParams]="profile"></p>