用分类控制器设计'翻译缺失'错误 [英] Devise 'translation missing' error with subclassed controller

查看:103
本文介绍了用分类控制器设计'翻译缺失'错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经分类为 Devise :: RegistrationsController 。在我的情况下,子类控制器是 AdminRegistrationsController



但是,当我注册一个新管理员时,例如, flash 显示消息:

翻译缺失:en.devise.admin_registrations .admin.signed_up



我已经验证了一个条目存在于 config / locales / devise.en.yml 。以下是摘录:

  en:
设计:
注册:
signed_up:'欢迎! '

我错过了什么?

解决方案

您必须这样做:

  en:
设计:
admin_registrations:
管理员:
signed_up:'欢迎!您已成功注册。'


I've subclassed Devise::RegistrationsController. The subclassed controller, in my case, is AdminRegistrationsController.

But, when I sign up a new admin, for example, the flash shows the message:

translation missing: en.devise.admin_registrations.admin.signed_up

I've verified an entry exists in config/locales/devise.en.yml. Here's the snippet:

en:
  devise:
    registrations:
      signed_up: 'Welcome! You have signed up successfully.'

What am I missing?

解决方案

You must do this :

en:
  devise:
    admin_registrations:
      admin:
        signed_up: 'Welcome! You have signed up successfully.'

这篇关于用分类控制器设计'翻译缺失'错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆