Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature: additional way to set displayName for property when creating ValidationRules #355

Closed
valichek opened this issue Oct 5, 2016 · 4 comments

Comments

@valichek
Copy link

valichek commented Oct 5, 2016

My intention is to have customizable translation of property names depending on validated model.
It could be smth like:

ValidationRules.ensure('myProp').on(target).setDisplayName((propertyName) => {
  return i18next.t(propertyName);
})
@jdanyow
Copy link
Contributor

jdanyow commented Oct 6, 2016

check out the customizing messages section in the docs. There's an example showing how to override getDisplayName.

@jdanyow
Copy link
Contributor

jdanyow commented Oct 6, 2016

Also related: #328

@valichek
Copy link
Author

valichek commented Oct 6, 2016

@jdanyow setting getDisplayName on MessageProvider is useful but too global.

@jdanyow
Copy link
Contributor

jdanyow commented Oct 6, 2016

ok- this sounds like it's a duplicate of #328 - please add any thoughts/use-cases there.

Thanks!

@jdanyow jdanyow closed this as completed Oct 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants