Ngx-translate with ionic elements


#1

Hi!
I’m trying to implement ngx-translate into my app. Ngx-translate has very convinient way of implementing translations with translate attribite
<div translate>TRANSLATE_KEY</div>
it works as intended with normal elements, but not with ionic elements
<ion-title>TRANSLATE_KEY</ion-title> doesn’t work.
Of course I could use translate pipe, but it looks ugly:
<ion-title>{{'TRANSLATE_KEY'|translate}}</ion-title>
Any solution to enable translate attribute with ionic elements?


#2

Yep, like you said, use the translate pipe

 <ion-title>{{'TRANSLATE_KEY ' | translate}}</ion-title> 

or

<ion-title [innerHTML]="'TRANSLATE_KEY ' | translate"></ion-title>