devise icon indicating copy to clipboard operation
devise copied to clipboard

Add separate translation keys for each Lockable strategy

Open f3ndot opened this issue 9 years ago • 4 comments

Presently there is only one i18n translation key, devise.failure.locked, regardless of the Lockable strategy used. It's default value is "Your account is locked.".

This is ok, but it'd be a minor improvement to provide different translation keys for each unlock strategy. I propose something along the lines of:

en:
  devise:
    failure:
      locked:
        none: "Your account is locked."
        email: "Your account is locked. An email has been sent with instructions on how to unlock your account."
        time: "Your account is locked. Your account will become available after a certain amount of time."
        both: "Your account is locked. An email has been sent with instructions on how to unlock your account, or wait a certain amount of time and try again."

This is good because if someone was to change their strategy and they customized locked around something specific to a strategy's details, it wouldn't bite them in the butt for forgetting to update locales.

f3ndot avatar Jun 24 '16 18:06 f3ndot

Plus more informational, sane defaults 😄

f3ndot avatar Jun 24 '16 18:06 f3ndot

@f3ndot sounds like a valid change, do you want to open a PR with that? 😄

lucasmazza avatar Jun 27 '16 19:06 lucasmazza

Closed via #4248

tegon avatar Mar 29 '18 21:03 tegon

Reopening to revisit at some point, see https://github.com/heartcombo/devise/pull/4248#issuecomment-3532916627.

carlosantoniodasilva avatar Nov 14 '25 13:11 carlosantoniodasilva