Reputation: 26650
I'm trying
ru:
activerecord:
errors:
format: "%{message}"
with no effect, but
ru:
activerecord:
errors:
messages:
record_invalid: "Неверные значения: %{errors}"
is working. I want to override both.
My Rails is 3.2.1 on the top of Ruby 1.9.3.
Upvotes: 2
Views: 1565
Reputation: 12300
In my opinion it would be better to use the localisation from this official source: https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/ru.yml
Upvotes: 1
Reputation: 2945
You can use this localization code
ru:
activerecord:
errors:
messages:
taken: "%{model} с таким именем уже существует"
record_invalid: "Валидация не прошла: %{errors}"
restrict_dependent_destroy:
one: "Невозможно удалить запись, так как существуют зависимости: %{record}"
many: "Невозможно удалить записи, так как существуют зависимости: %{record} "
inclusion: "недопустимое значение"
exclusion: "is reserved"
invalid: "содержит недопустимое значение"
confirmation: "doesn't match confirmation"
accepted: "must be accepted"
empty: "не может быть пустым"
blank: "не может быть пустым"
too_long: "слишком длинно (максимум: %{count} символов)"
too_short: "слишком коротко (минимум: %{count} символов)"
wrong_length: "is the wrong length (should be {{count}} characters)"
taken: "%{attribute} уже занята"
not_a_number: "может содержать только цифры"
greater_than: "должно быть больше {{count}}"
greater_than_or_equal_to: "должно быть больше или равно {{count}}"
equal_to: "должно быть равно {{count}}"
less_than: "должно быть меншье {{count}}"
less_than_or_equal_to: "должно быть меньше или равно {{count}}"
odd: "может быть только нечетным"
even: "может быть только четным"
Take a look at this gist for more info.
Upvotes: 3