The file that describes the Japanese translation of the column name did not work well because the error message was translated into Japanese.
Once I arranged the spacing of the description, it worked. I was able to learn anew that there are other things that do not work with spacing other than typographical errors.
config/locales/models/ja.yml
#It doesn't work well unless the hierarchical structure is represented by spacing
ja:
activerecord:
models:
event:Event
attributes:
event:
name:event name
place:Venue
content:Event content
Install the gem "rails-i18n"
Gemfile
gem 'rails-i18n'
↓ bundle install ↓ Edit the description of config/application.rb
config/application.rb
config.i18n.default_locale = :ja
Now you can translate it into Japanese. However, the column names are still written in English, so (Example) Please enter an email I get an error message like this.
Create a file called "ja.yml" in config/locales/models /. Describe the Japanese corresponding to the column name in the created file.
config/locales/models/ja.yml
#It doesn't work well unless the hierarchical structure is represented by spacing
ja:
activerecord:
models:
event:Event
attributes:
event:
name:event name
place:Venue
content:Event content
Japanese localization of Rails validation error message
Recommended Posts