Q: Custom methods and messages when using i18n
See original GitHub issueVersions
- vee-validate: 2.1.0-beta6
- vue: 2.5.2
Hello, I was trying to follow the documentation here: https://baianat.github.io/vee-validate/guide/localization.html
I am unable to figure how to replace the message thrown by required and at the same time merge my own custom messages.
So far this is what I have done but it is awful and will not work with dynamically generated fields:
https://codesandbox.io/s/pkoo113447
Is there a way I could add a method to validaton.js such as:
required: () => 'This field is required.'
Or any other to fix this?
Thank you
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Q: Custom methods and messages when using i18n ... - GitHub
In our application, we use vue-i18n and store custom messages there. We use lazy loading for the i18n locale files and the vee-validate...
Read more >Ruby on Rails i18n - Want To Translate Custom Messages in ...
Custom validation with i18n message: ... To make your models cleaner, you can create a custom validation helper method in an entirely new ......
Read more >i18n in Java 11, Spring Boot, and JavaScript - Okta Developer
Learn how to internationalize and localize your Java and Spring Boot apps.
Read more >KI18n - Programmer's Guide - KDE API Reference
Most messages can be internationalized with simple i18n* calls, which are described in the section gen_usage. A few messages may require treatment with...
Read more >Advanced Features: Internationalized Routing - Next.js
Next.js has built-in support for internationalized (i18n) routing since v10.0.0 . You can provide a list of locales, the default locale, and domain-specific ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Sorry for the late response, like @nicokoenig pointed out the dictionary API allows you to do all of these things, I think the docs could be revisited to make things clearer about the localization.
Thanks @nicokoenig for keeping an eye out and responding for these issues, much appreciated!
Okay, there is even a more simple approach.
You can simply do this:
This is also described in the docs, so no need for a PR 😄