3

我已经在我的控制器中设置了这样的 Flash 消息

flash[:error] = t 'auth.login.empty'

我的 en.yml 文件有

en:
  auth:
    login:
      success: "Successfully logged in"
      empty: "Empty field cannot accespted"
      error: "Username and password doesn't match"

都是两个space indent

我越来越闪光了translation missing: en.auth.login.empty

我是否必须进行一些配置更改。

4

2 回答 2

1

您的代码实际上缩进了成功、空和错误键的标签。我现在已经解决了这个问题。

请确保您确实在使用空格。我不知道为什么会中断的其他原因。

于 2013-10-01T04:43:45.147 回答
1

我刚碰到这个。

我在文件顶部设置的密钥稍后在文件中被覆盖:

# This was showing up as missing
invite:
  intent_msg: "Test intent message."

# because waaaay farther down the file I had the following:

invite:
  button_text: "<i class='fi-mail'></i> Send Invite"

尽管这两个翻译是针对不同的键,但第二个会杀死第一个。

所以现在我有了这个:

invite:
  intent_msg: "Test intent message."
  button_text: "<i class='fi-mail'></i> Send Invite"

一切都好起来了。小心那个人。

于 2017-05-07T00:18:04.703 回答