Я попробовал решение для этого, и оно работает, вот как мне удалось перевести мои предупреждения ngx-toaster, которые вызываются в моем файле ts, например, у меня есть это:
ngOnInit() {
this.toastrService.success('created successfully', '');
}
я преобразовал его в этот
@ViewChild('test') myDivElementRef: ElementRef;
...
constructor(private toastrService: ToastrService) {}
ngOnInit() {
this.toastrService.success(this.myDivElementRef.nativeElement.outerHTML, '', {
enableHtml : true
});
и в своем шаблоне я создаю div с #test reference
<h2 i18n="@@testTitle" #test [hidden]="true">created successfully</h2>