An extension for Transloco that provides a <transloco> component for rendering translations with markup. Current stable version 6.0.2 works with Angular >=17 and @jsverse/transloco ^7. Released periodically, with major versions aligned with Angular major versions. Key differentiator: avoids splitting translations or using [innerHtml] for inline markup like links and bold text, reducing injection risks.
npm install ngx-transloco-markupNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use the <transloco> component in a standalone Angular component with a translated string containing bold markup.
Update Angular to version 17+.
Upgrade Transloco to v7.
Use provideTranslocoMarkup() without arguments.
Ensure you import or provide necessary transpilers (e.g., BoldTranspiler) in your module or component.
Avoid passing untrusted translation keys; the component does not sanitize arbitrary HTML.
If using NgModule, add TranslocoMarkupModule (if exists) instead. For new projects, use standalone components.
Call provideTranslocoMarkup() in your application config or add TranslocoMarkupModule.forRoot() in your root module.
Upgrade @jsverse/transloco to ^7.