Merge pull request #4936 from betagouv/fix-champ-localization
locales: fix translation of champ value
This commit is contained in:
commit
b8cbe55ce4
3 changed files with 5 additions and 5 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
fr:
|
||||
activerecord:
|
||||
attributes:
|
||||
champs:
|
||||
champ:
|
||||
value: La valeur du champ
|
||||
|
|
Loading…
Reference in a new issue