InterviewHubPRO
Section Overview
Q183

Question 183 of 283

Part 8: Internationalization (i18n), Testing & DOM Directives (177 - 212)

65%
Angular & Signals (283 Qs)•Part 8: Internationalization (i18n), Testing & DOM Directives (177 - 212)

Can I translate text without creating an element?

Yes, you can achieve using <ng-container> attribute. Normally you need to wrap a text content with i18n attribute for the translation. But if you don't want to create a new DOM element just for the sake of translation, you can wrap the text in an <ng-container> element.

html
<ng-container i18n>I'm not using any DOM element for translation</ng-container>

Remember that <ng-container> is transformed into an html comment