Closed allanojeda closed 1 year ago
+1... anyone?
does anyone have solution for this issue? @toonvanstrijp
Remove the code that instantiates validation pipe. You can pass the same options (except exceptionFactory
) to I18nValidationPipe.
app.useGlobalPipes(new I18nValidationPipe({ transform: true}));
app.useGlobalFilters(
new I18nValidationExceptionFilter({
}),
);
Marking this as resolved
same problem
Currently I'm having issues trying to translate the class-validators errors in a DTO. I set up main.ts, and dto as documented.
Main:
dto:
app.module:
I18nModule.forRoot({ fallbackLanguage: 'en', loaderOptions: { path: join(__dirname, '/langs/'), watch: true, }, resolvers: [new HeaderResolver(['lang']), AcceptLanguageResolver], }),
the langs folder has this type of structure:
/langs/en/validation.json
I'm not using graphql, and the response I get after trying to see the errors translation for a bad input:
As seen, I am not able to get the translation of validation.password key. Im not sure whats wrong, because I am able to translate custom messages in my services using I18nService. I'm using node v16.14.1 with NestJS framework.