DEVISE.Registrations.reasons nei file YML è deprecato?
-
28-10-2019 - |
Domanda
Ho appena aggiornato a Rails 3.2 e dopo aver avviato Webrick ricevo il seguente errore:
[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.'
Nel mio file locale di idee ho un'altra riga:
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'
Scusa, sono un principiante di Rails. Cosa devo cambiare esattamente? E come?
Soluzione
Mi sono appena imbattuto in questo. Questo sembra funzionare bene:
In config> Locali> DEVISE.EN.YML> Informazioni sulla riga 36 Modifica il blocco delle registrazioni in:
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.'
BTW: assicurati di rimuovere il bit:
reasons:
inactive: 'inactive'
unconfirmed: 'unconfirmed'
locked: 'locked'
Saluti, Matt
Altri suggerimenti
Basta aggiungere come risposta che puoi ottenere un deviazione aggiornato.en.yml e per altri locali da https://github.com/plataformatec/devise/wiki/i18n
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow