4
我在我的应用程序中使用了twitter-bootstrap-rails
gem。它似乎来了一系列的,在一个主题视图,例如创建编辑和删除按钮的辅助方法:rails twitter bootstrap帮手方法
<%= link_to t('.destroy', :default => t("helpers.links.destroy")),
cohort_path(cohort),
:method => :delete,
:confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')),
:class => 'btn btn-mini btn-danger' %>
在哪里这些T()方法和助手定义?我该如何改变它们?例如,如果我想改变在销毁按钮上的标签为“删除”我可以改变上面:
<%= link_to t('.destroy', :default => "Delete"),
cohort_path(cohort),
:method => :delete,
:confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')),
:class => 'btn btn-mini btn-danger' %>
我真的很想做的是改变t("helpers.links.destroy")
显示“删除”,而不是“摧毁“我的观点。我可以这样做吗?感谢你的帮助!
Doooh。我找到了。与Bootstrap无关。 l18n翻译API:t简写为tran,l简写为locale http://guides.rubyonrails.org/i18n.html – donsteffenski