(Flow after installing devise)
Install gem ・ Gem'devise-i18n' ・ Gem'devise-i18n-views'
Generate a Japanese translation file with the command
Edit devise.views.ja.yml
gem 'devise-i18n'
gem 'devise-i18n-views'
Write in gemfile and do “$ bundle install”
$ rails g devise:views:locale ja
When the command is executed, the Japanese translation file config / localesdevise.views.ja.yml Is generated.
Edit the generated config / localesdevise.views.ja.yml.
ruby:config/localesdevise.views.ja.yml
ja:
activerecord:
errors:
models:
user:
attributes:
email:
taken: "Is already in use."
blank: "Is not entered."
too_short: "Is%{count}Please set more than characters."
too_long: "Is%{count}Please set it below the character."
invalid: "Is not valid."
password:
taken: "Is already in use."
blank: "Is not entered."
too_short: "Is%{count}Please set more than characters."
too_long: "Is%{count}Please set it below the character."
invalid: "Is not valid."
confirmation: "Does not match the content."
attributes:
user:
current_password: "Current password"
name:name
email: "mail address"
password: "password"
password_confirmation: "Confirmation password"
remember_me: "login automatically from now on"
models:
user: "User"
devise:
confirmations:
new:
resend_confirmation_instructions: "Resend account confirmation email"
mailer:
confirmation_instructions:
action: "Account confirmation"
greeting: "Welcome,%{recipient}Mr.!"
instruction: "The following link will complete the confirmation of your email address:"
reset_password_instructions:
action: "Change Password"
greeting: "Hello,%{recipient}Mr.!"
instruction: "Someone wants to reset my password. You can reset your password at the following link."
instruction_2: "Ignore this email if you didn't want it."
instruction_3: "Your password will not change until you access the link above and set a new password."
unlock_instructions:
action: "Account unlock"
greeting: "Hello,%{recipient}Mr.!"
instruction: "Click the link below to unlock your account."
message: "Your account is locked due to repeated login failures."
passwords:
edit:
change_my_password: "change the password"
change_your_password: "Change password"
confirm_new_password: "New password for confirmation"
new_password: "new password"
new:
forgot_your_password: "Did you forget your password??"
send_me_reset_password_instructions: "Send how to reset your password"
registrations:
edit:
are_you_sure: "Is it really good?"
cancel_my_account: "Account deletion"
currently_waiting_confirmation_for_email: "%{email}Waiting for confirmation"
leave_blank_if_you_don_t_want_to_change_it: "If left blank, do not change"
title: "%{resource}Edit"
unhappy: "I don't like it"
update: "update"
we_need_your_current_password_to_confirm_your_changes: "Please enter your current password for the changes to take effect"
new:
sign_up: "account registration"
sessions:
new:
sign_in: "Login"
shared:
links:
back: "Return"
didn_t_receive_confirmation_instructions: "Did you receive an account confirmation email??"
didn_t_receive_unlock_instructions: "Have you received an email on how to unfreeze your account??"
forgot_your_password: "Did you forget your password??"
sign_in: "Login"
sign_in_with_provider: "%{provider}Login with"
sign_up: "account registration"
unlocks:
new:
resend_unlock_instructions: "Resend account unfreeze method"
I think you can translate it into Japanese!
I wrote it like a memo! Please refer to it if you like.
reference https://remonote.jp/rails-devise-i18n-locale-ja
Recommended Posts