Issue
I need to internationalize a ternary expression with i18n in Angular. How to do this?
<ion-title i18n>{{currentStep === 0 ? 'New chat' : 'New room'}}</ion-title>
Solution
Ok, I got it. We can rewrite this expression in non-ternary and apply i18n directive.
<ion-title>
<ng-container *ngIf="currentStep === 0; else newRoom" i18n="@@newChat">New chat</ng-container>
<ng-template #newRoom i18n="@@newRoom">New room</ng-template>
</ion-title>
Answered By - jaba
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.