config/application.rb
class Application < Rails::Application
#Japanese language setting
config.i18n.default_locale = :ja
#abridgement
end
#Gemfile
gem 'rails-i18n'
After writing Terminal bundle install
Japanese registered in rails-i18n https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/ja.yml
Now I can translate what is written in rails-i18n However, other words have not been translated into Japanese.
config>locales>devise.ja.yml Create a file
Copy the Japanese translation of devise and paste it into the devise.ja.yml you just created https://github.com/tigrish/devise-i18n/blob/master/rails/locales/ja.yml
config>locals>ja.yml
ja:
activerecord:
attributes:
user:
nickname:nickname
tweet:
text:text
image:image
The nickname of the user table is translated into Japanese The text of the tweet table is translated into Japanese image is translated into Japanese
Recommended Posts