heartcombo / simple_form

Forms made easy for Rails! It's tied to a simple DSL, with no opinion on markup.
http://blog.plataformatec.com.br/tag/simple_form
MIT License
8.21k stars 1.31k forks source link

Custom default error message with simple_form is not loaded #1718

Closed Narf-stack closed 3 years ago

Narf-stack commented 3 years ago

Hi, I can't manage to change the default error message from simple form, i tried to edit the simple_form.en.yml file. I used differents approachs but the outcome was still the same, my update was ignored. First, I simply tried to update the default_message variable, then I specified a default message according to the name of my models. I also tried to update the gem version from 4.1.0 to 5.0.3, but that was not enough.

Here is my current file :

en: simple_form: error_notification: default_message: "Original default message:" model_name: "A custom message:"

Environment

Current behavior

My custom error_notification message is ignored. I can only see the " Please review the problems below:" message

Expected behavior

Using my custom message for error notifications.

marcelolx commented 3 years ago

@Narf-stack Could you provide a sample app reproducing the problem you are facing? I've tested this functionality here and it works as expected 🤔

Maybe it can be related to indentation, have you verified it?

en:
  simple_form:
    error_notification:
      default_message: "Default generic error message"

image

en:
  simple_form:
    error_notification:
      default_message: "Default generic error message"
      user: "Specific user error notification"

image

marcelolx commented 3 years ago

@carlosantoniodasilva I think we can close this issue due the lack of info.

feliperenan commented 3 years ago

Thanks for looking to it @marcelolx.