For every language you would have a separate file in your Angular applications assets:
Each of these translation files contains key-value pairs, i. e. en.json
{
"MY_LABEL": "My translation text"
}
and de.json
{
"MY_LABEL": "Mein übersetzungstext"
}
In your template you can then use the translate pipe as follows
{{ 'MY_LABEL' | translate }}
and ngx will chose the right translation file according to the language selected.
So your columns array should not contain the translated values. It should only contain the labels. The actual translated values should only appear in your translation file.
your.component.ts
columns = [
{ label: 'YOUR_COMPONENT-NOMBRE', propertyName: 'name' }
]
your.component.html
{{ col.label | translate }}
es.json
{
'YOUR_COMPONENT-NOMBRE': 'nombre'
}
Following the usage guide you also have to do some configuration in your app module.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…