10

I just updated to Rails 3.2 and after starting WEBrick I get the following error:

[DEVISE] devise.registrations.reasons in yml files is deprecated, please use devise.registrations.signed_up_but_REASON instead. The default values are:

en:
  devise:
    registrations:
      signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
      signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
      signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'



[DEVISE] devise.registrations.inactive_signed_up in yml files is deprecated, please use devise.registrations.signed_up_but_REASON instead. The default values are:

en:
  devise:
    registrations:
      signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
      signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
      signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'

In my devise locale file I have another lines:

  registrations:
      signed_up: 'Welcome! You have signed up successfully.'
      inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.'
      updated: 'You updated your account successfully.'
      destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
      reasons:
        inactive: 'inactive'
        unconfirmed: 'unconfirmed'
        locked: 'locked'

Sorry I'm a Rails beginner. What exactly I have to change? And How?

4

2 回答 2

12

我也刚遇到这个。这似乎工作正常:

在 config > locales > devise.en.yml > about line 36 中将注册块更改为:

registrations:
    signed_up: 'Welcome! You have signed up successfully.'
    updated: 'You updated your account successfully.'
    destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
    signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
    signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
    signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'

顺便说一句:确保删除该位:

reasons:
    inactive: 'inactive'
    unconfirmed: 'unconfirmed'
    locked: 'locked'

干杯,马特

于 2012-02-20T18:44:30.223 回答
3

只需添加作为答案,您可以从https://github.com/plataformatec/devise/wiki/I18n获得更新的 devise.en.yml 以及其他语言环境

于 2012-03-18T21:15:27.407 回答