に変更:default_message
します:your_model_name
sourceでわかるように、error_notification
メソッドはtranslate_error_notification
YAML ファイルから翻訳を取得するために使用します。
def translate_error_notification
lookups = []
lookups << :"#{object_name}"
lookups << :default_message
lookups << "Please review the problems below:"
I18n.t(lookups.shift, scope: :"simple_form.error_notification", default: lookups)
end
user
モデルのlookups
内容:
lookups == [:user, :default_messge, "Please review the problems below:]
変換はオブジェクトごとに異なる可能性があるため、このトランザクションが呼び出されます。
#config/locales/simple_form.en.yml
en:
simple_form:
error_notification:
user: "A custom message:"
それが役立つかどうか投票してください;)