angularlocalizationangular-translateangular-localize

Mat-tab angular-localize proper way to translate


Lets say i have mat tam created like this

<mat-tab-group>
    <mat-tab label="nameToBeTranslated">
    </mat-tab>
</mat-tab-group>

How can i translate that label?


Solution

  • You can use :

    <mat-tab-group>
        <mat-tab label="{{'nameToBeTranslated' | translate}}">
        </mat-tab>
    </mat-tab-group>
    

    or

    <mat-tab-group>
        <mat-tab [label]=" 'now you can use pipes here' | anyPipeForTranslation">
        </mat-tab>
    </mat-tab-group>