locales: fix translation of champ value

Due to the extra 's', the names of Champs attributes were never
translated.
This commit is contained in:
Pierre de La Morinerie 2020-03-24 14:28:21 +00:00
parent 12166e29bb
commit a716713ed6
3 changed files with 5 additions and 5 deletions

View file

@ -2,8 +2,8 @@ class Champs::DecimalNumberChamp < Champ
validates :value, numericality: {
allow_nil: true,
allow_blank: true,
message: -> (object, data) {
"« #{object.libelle} » " + object.errors.generate_message(data[:attribute].downcase, :not_a_number)
message: -> (object, _data) {
"« #{object.libelle} » " + object.errors.generate_message(:value, :not_a_number)
}
}

View file

@ -3,8 +3,8 @@ class Champs::IntegerNumberChamp < Champ
only_integer: true,
allow_nil: true,
allow_blank: true,
message: -> (object, data) {
"« #{object.libelle} » " + object.errors.generate_message(data[:attribute].downcase, :not_an_integer)
message: -> (object, _data) {
"« #{object.libelle} » " + object.errors.generate_message(:value, :not_an_integer)
}
}

View file

@ -1,5 +1,5 @@
fr:
activerecord:
attributes:
champs:
champ:
value: La valeur du champ