If the parameter is an object, the translation service searches the names its properties surrounded by double curly brackets. When it finds one, it will be replaced by the value of the given property, e.g.:
// app.en.json
{
"welcome": "Welcome, {{ name }}!"
}
// app.compoonent.html
<div>{{ 'app.welcome' | translate:{ name: 'John' } }}</div>
// Output: Welcome, John!
When the parameter is an array, the translation service searches the indeces of the array items surrounded by double curly brackets:
// app.en.json
{
"welcome": "Welcome, {{ 0 }}!"
}
// app.compoonent.html
<div>{{ 'app.welcome' | translate:[ 'John' ] }}</div>
// Output: Welcome, John!
In case of the parameter being a string, number or Boolean, the search phrase is always {{0}}:
// app.en.json
{
"welcome": "Welcome, {{ 0 }}!"
}
// app.compoonent.html
<div>{{ 'app.welcome' | translate:'John' }}</div>
// Output: Welcome, John!
See the Localization chapter to learn how to localize the inserted values.