My objective is to streamline the code by using the Angular translate pipe. Currently, I find myself using 8 curly brackets and repeating the word "translate" twice... there must be a more efficient approach.
Here is my current code setup:
<span
*ngIf="checkoutForm.get('email')?.errors?.['email']">
{{ 'eMail' | translate }} {{ lowerCaseFirstLetter('isInvalid' | translate) }}
</span>
I am attempting to condense it to something like:
<span
*ngIf="checkoutForm.get('email')?.errors?.['email']"
translate>eMail {{ lowerCaseFirstLetter('isInvalid' | translate) }}
</span>
or even simpler:
<span
*ngIf="checkoutForm.get('email')?.errors?.['email']"
translate>eMail lowerCaseFirstLetter('isInvalid')
</span>
The Text
Email is translated as = E-Mail
IsInvalid is translated as = Is invalid
lowerCaseFirstLetter() is a function that only lowers the first letter, which is crucial to maintain orthography in other languages