I can't hide my confusion about Markdown notation in my first post, but I'd like to gradually get used to it.
This time, when I tried to translate the error message into Japanese, I could not log in as a user by devise, so I would like to share how to solve it.
Ruby 2.6.5 devise 4.7.3
I wrote the following code in each file. For some reason I got an error when I pasted the latest devise.en.yml file (ver.> = 4.2.0). Using the version below it (> = 3.4.0) solved it.
config/webpack/application.rb
module ChatDiary
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.0
config.time_zone = 'Asia/Tokyo'
config.i18n.default_locale = :ja
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.
end
end
ruby:config/locales/devise.en.yml
ja:
devise:
confirmations:
confirmed: 'I have registered an account.'
send_instructions: 'We will email you within minutes about activating your account.'
send_paranoid_instructions: "If your email address is already registered, you will receive a verification email within minutes."
failure:
already_authenticated: 'You are already logged in.'
inactive: 'Your account has not been activated. Follow the steps in the email to activate your account.'
invalid: "%{authentication_keys}Or the password is invalid."
locked: 'Your account is frozen.'
last_attempt: 'Multiple operations have been performed before your account was frozen.'
not_found_in_database: "%{authentication_keys}Or the password is invalid."
timeout: 'The session has timed out. Please log in again.'
unauthenticated: 'Please register for an account or log in.'
unconfirmed: 'You will need to verify your email address.'
mailer:
confirmation_instructions:
subject: 'About account activation'
reset_password_instructions:
subject: 'About resetting password'
unlock_instructions:
subject: 'About unfreezing your account'
omniauth_callbacks:
failure: "%{kind}Failed to authenticate with your account. Reason:(%{reason})"
success: "%{kind}You have successfully authenticated with your account."
passwords:
no_token: "You cannot access this page. If you are accessed from the link in the password reset email, please check the URL."
send_instructions: 'We will email you within a few minutes to reset your password.'
send_paranoid_instructions: "If your email address is already registered, you will receive an email to reset your password within minutes."
updated: 'The password has been changed correctly.'
updated_not_active: 'The password has been changed correctly.'
registrations:
destroyed: 'I deleted my account. We look forward to seeing you again.'
signed_up: 'Account registration is complete.'
signed_up_but_inactive: 'Please activate your account to log in.'
signed_up_but_locked: 'I can't log in because my account is frozen.'
signed_up_but_unconfirmed: 'I sent an email to verify my identity. Please activate your account from the link in the email.'
update_needs_confirmation: 'I changed my account information. To verify the identity of the changed email address, please perform the verification process from the identity verification email.'
updated: 'I changed my account information.'
sessions:
signed_in: 'You are now logged.'
signed_out: 'logged out.'
already_signed_out: 'You have already logged out.'
unlocks:
send_instructions: 'We will email you within minutes on how to unfreeze your account.'
send_paranoid_instructions: 'If you find your account, we will email you within minutes on how to unfreeze your account.'
unlocked: 'I have unfrozen my account.'
errors:
messages:
already_confirmed: 'Is already registered. Please login.'
confirmation_period_expired: "Has expired.%{period}You need to confirm by. Please make a new request."
expired: 'Has expired. Please make a new request.'
not_found: 'Was not found.'
not_locked: 'Is not frozen.'
not_saved:
one: "Because an error occurred%{resource}Was not saved:"
other: "%{count}Because an error occurred%{resource}Was not saved:"