Ruby on rails rails翻译丢失错误
我已经在我的控制器中设置了这样的flash消息Ruby on rails rails翻译丢失错误,ruby-on-rails,ruby-on-rails-3,Ruby On Rails,Ruby On Rails 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" 都是两个空格缩进 我收到fl
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"
都是两个空格缩进
我收到flash,因为翻译缺失:en.auth.login.empty
是否必须进行一些配置更改。您的代码实际上缩进了成功键、空键和错误键的选项卡。我现在已经修好了 请确保您确实在使用空格。我不知道为什么会断开。我只是遇到了这个 我在文件顶部设置的一个键稍后在文件中被重写:
# 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"
#这显示为丢失
邀请:
意图消息:“测试意图消息。”
#因为WAAAY位于文件的更深处,所以我有以下内容:
邀请:
按钮\文本:“发送邀请”
尽管这两种翻译是针对不同的键,但第二种翻译却扼杀了第一种翻译
现在我有了这个:
invite:
intent_msg: "Test intent message."
button_text: "<i class='fi-mail'></i> Send Invite"
邀请:
意图消息:“测试意图消息。”
按钮\文本:“发送邀请”
一切又好了。
请注意这一点。您尝试重新启动服务器了吗?请再次关闭和打开:)很抱歉,我现在无法测试它。我使用了标签大小为2的标签。我们应该使用空格而不是标签,对吗?