M
M
MrChen2016-06-28 17:25:31
Laravel
MrChen, 2016-06-28 17:25:31

How to change laravel validation language to Russian?

Hey guys! Laravel has validation, but it's in English by default. Actually the question is this: "How to change the validation language?".

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vlad, 2016-06-29
@Result007

Hey!
First, in config/app.php change:
Secondly, in the resources/lang path, create the ru folder. And then throw these files there: https://github.com/caouecs/Laravel-lang/tree/maste...
You can describe your mistakes inside the files.

A
Anatoliy Lyovkin, 2016-06-28
@Alyovkin

You can send messages directly toValidator

$messages = array(
    'required' => 'Поле :attribute должно быть заполнено.',
);

$validator = Validator::make($input, $rules, $messages);

the :attribute string will be replaced with the name of the field being checked.
You can also add messages to the localization file, for example:app/lang/xx/validation.php
'custom' => array(
    'email' => array(
        'required' => 'Нам нужно знать ваш e-mail адрес!',
    ),
),

N
neol, 2016-06-28
@neol

https://laravel.com/docs/5.1/validation#custom-err...
https://github.com/caouecs/Laravel-lang

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question