The error message is – zone.js:1049 Error: NG0204: Can’t resolve all parameters for I18n: (?, ?, ?).
It works when using Angular 15 and I have tried switching to using @ngx-translate/core but I don’t want to waste too much rewriting all my html and typescript code.
app.module.ts
import { I18n } from "@ngx-translate/i18n-polyfill";
@NgModule({
imports: [
],
declarations: [AppComponent],
bootstrap: [AppComponent],
providers: [
{
provide: TRANSLATIONS, useFactory: (locale) => {
switch (locale) {
case 'ja':
locale = 'ja';
break;
case 'ru':
locale = 'ru';
break;
default:
locale = 'en-US';
}
return require(`raw-loader!../locale/messages.${locale}.xlf`).default;
},
deps: [LOCALE_ID]
},
{
provide: LOCALE_ID,
useFactory: localeFactory
},
[I18n],
]
})