仅链接标题缺少翻译
我正在使用 I18n,它工作正常,但我注意到它显示链接标题中缺少翻译:
<li><%= link_to t("menu.admin.publishers"), admin_publishers_path %></li>
我在 en.yml 中有这个:
en:
menu:
admin:
publishers: "Publishers"
但它正在生成:
<li><a href="/admin/publishers"><span class="translation_missing" title="translation missing: en.menu.admin.publishers">Publishers</span></a></li>
所以在 span 标记的内容中翻译正确,但在标题它正在生成翻译缺失错误。我知道它添加了两倍的语言前缀。
我使用的是 Rails 3.0.7,区域设置配置是默认的。
我按照 http://guides.rubyonrails.org/i18n.html 上的文档进行操作,但没有成功。
有人知道如何解决这个问题吗?或者以前见过这个?
I'm using I18n and it works fine but I noticed that it shows a translation missing in the link's title:
<li><%= link_to t("menu.admin.publishers"), admin_publishers_path %></li>
I have this in the en.yml:
en:
menu:
admin:
publishers: "Publishers"
But it is generating:
<li><a href="/admin/publishers"><span class="translation_missing" title="translation missing: en.menu.admin.publishers">Publishers</span></a></li>
So in the content of the span tag is translating correctly but in title it is generating a translation missing error. I understood that it is adding twice the language prefix.
I'm using rails 3.0.7 and the locale config is the default one.
I followed the documentation on http://guides.rubyonrails.org/i18n.html but with no success.
Anyone knows how to solve this? or have seen this before?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论