[Question] ngx-translate support?
Hello
I'd like to use this with ngx-translate. Is this somewhere on your roadmap?
Same question here
Any ideas when this feature would be implemented?
Yes, you can use it easily.
In app.module.ts (before you have to config TranslateModule): providers: [ TranslateService, { provide: CUSTOM_ERROR_MESSAGES, useFactory: CustomErrorFactory, deps: [TranslateService], multi: true } ],
xy.ts: export const CustomErrorFactory = (translateService: TranslateService): ErrorMessage[] => { return [ { error: "required", format: (label, error) => requiredFormat(label, error, translateService) } ]; }
export function requiredFormat(label: string, error: any, translateService: TranslateService): string { return translateService.instant('RequiredErrorMessage'); }