Custom error message for carrierwave 0.9.0 doesn't work for Rails 4

前端 未结 3 2030
遥遥无期
遥遥无期 2021-01-25 13:38

I use carrierwave 0.9.0 with Rails 4 and I\'m trying to make a custom error message. After doing some search, I found this answer:

en:
  errors:
            


        
3条回答
  •  清酒与你
    2021-01-25 14:03

    I use a rails 5.1 I created a file config/locales/carrierwave.ar.yml and wrote

    ar:
      carrierwave:
      errors:
        messages:
          min_size_error: "حجم الصورة لابد أن يكون أكبر من %{min_size}"
          max_size_error: "حجم الصورة لابد أن يكون أقل من %{max_size}"
          ....
    

    You can take a look at this file :)

提交回复
热议问题