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