仅链接标题缺少翻译

发布于 2024-12-05 18:03:16 字数 756 浏览 1 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文