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

Add adapter for validation translations #757

Merged

Conversation

wout
Copy link
Contributor

@wout wout commented Oct 29, 2021

This PR adds the possibility to configure a custom i18n backed for validation translations, as discussed in #754. It also adds simple interpolation using format strings to create clearer error messages. For example in validate_size_of, the error message for min used to be "is too short", and is now "must have at least %s characters".

@wout
Copy link
Contributor Author

wout commented Oct 29, 2021

I noticed this PR also includes the migration order changes (sloppy me). Sorry about that. 😊

Copy link
Contributor

@robacarp robacarp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty cool, and a great direction to move in. I love the use of String#% especially.

Copy link
Member

@jwoertink jwoertink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dig it! This is a great step forward. Just a small note on your spec helper, but otherwise I think it's good.

@jwoertink
Copy link
Member

Awesome! This looks great to me. I'll merge it in so we can start playing with it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants