class-validator
class-validator copied to clipboard
feat: Adds support for translating validation messages
Description
Previously, error messages returned by validations were fixed in English. This implementation introduces support for translation, allowing the package to translate messages into English, Portuguese (Brazil), and Spanish using its own translation system.
The feature is also designed to be extensible, enabling users to add new languages without modifying the package code.
Additionally, the implementation supports integration with the i18n and nestjs-i18n packages, facilitating dynamic language changes during runtime.
Checklist
- [x] the pull request title describes what this PR does (not a vague title like
Update index.md) - [x] the pull request targets the default branch of the repository (
develop) - [x] the code follows the established code style of the repository
npm run prettier:checkpassesnpm run lint:checkpasses
- [x] tests are added for the changes I made (if any source code was modified)
- [x] documentation added or updated
- [x] I have run the project locally and verified that there are no errors
Fixes
fixes #169