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

Language #7

Open
BondarenkoAlex opened this issue Nov 25, 2016 · 1 comment
Open

Language #7

BondarenkoAlex opened this issue Nov 25, 2016 · 1 comment

Comments

@BondarenkoAlex
Copy link

Hello.
How can I set the language 'ru' ?

@DanFMoore
Copy link
Owner

You can do it like this (see third parameter):

this.validatorTypes = strategy.createSchema(
    // First parameter is a list of rules for each element name
    {
        name: 'required',
        email: 'required|email',
        age: 'min:18'
    },
    // Second parameter is optional and is a list of custom error messages for elements
    {
        "required.email": "Without an :attribute we can't reach you!"
    }
    // Third parameter is also optional; a callback that takes the validator instance created
    // and can be used to call methods on it. This is run at the point of validation.
    function (validator) {
        validator.lang = 'ru';
    }
);

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

No branches or pull requests

2 participants