Closed EizFeren closed 1 year ago
Try this https://github.com/toonvanstrijp/nestjs-i18n/tree/main/samples/dto-validation. Also show your i18n files.
Have a hunch it might be due to the way you have nested the i18nValidationMessage
key
Looks like problem is with testing environment. Idk how it can relate, but in fact - I tested this setup with live app, and error messages were translated correctly.
Then I've launched exact same code with supertest - and got bugged error messages. Perharps all another error messages with supertest were ok, except these for id check
Describe the bug
I've got very strange bug with some of
class-validator
identifiers -i18nValidationMessage
does not translate message for them. All setup except details is same as described in quickstart guide.Here's my setup to reproduce.
DTO with decorators:
validation.id.int
andvalidation.id.min
are simple strings,Id should be integer number
andId should be positive
.Actual result I have with this setup:
I've tried some antoher decorators, such as
IsNotEmpty
,IsEmail
,IsStrongPassword
, and translation for them is working correctly. Also I've done some check for this case withI18nService
- it translatesvalidation.id.int
andvalidation.id.min
correctly.Reproduction
Provided in description
System Info
Used Package Manager
npm
Validations