When the Rails error message is translated into Japanese, only the attribute name of the model is written in English alphabet. .. .. Since I fell into the situation, I will record the way to solve it.
Create a new file under config/initializers/(name the file locale.rb for the time being). Described as follows.
config/initializers/locale.rb
I18n.config.available_locales = :ja
I18n.default_locale = :ja
Create a file called ja.yml in config/locales /. You can write the contents to be described in it by yourself, but since there are already created ones, save here by copying or downloading.
This will restart the Rails server. If you press the registration button intentionally with the blank on the new creation screen (validation that will cause an error if you try to register with a blank) so that an error will appear ... It's definitely in Japanese, but ... Task name, Detail, Deadline are still in alphabetical notation.
As I wrote in the title, these are not the default Japanese notation, but the attribute names of the model I named, so they are treated differently. In order to make these into Japanese, you have to prepare another file.
This time, create a dictionary "model.ja.yml" that converts the model into a Japanese table in config/locales /.
config/locales/model.ja.yml
ja:
activerecord:
models:
task:blog
user:user
attributes:
task:
task_name:Task name
detail:Details
deadline:Deadline
user:
title:title
name:name
email:mail address
current_password:Current password
password:password
password_confirmation:Confirmation password
remember_me:Remember login
In this way, describe the Japanese corresponding to the model attribute. Now restart the server and try to get the error in the same way as before ... The model attribute part is also in Japanese.