1
我有点困惑,我该如何指定什么日期时间格式(或在这种情况下,特别是日期格式)应该用来翻译本地化的字符串内的日期。Rails I18n:日期时间格式里面翻译的字符串
到目前为止,我有这样的:
# config/locales/en.yml
en:
date:
formats:
month: '%B %Y'
texts:
only_showing_between: "Only showing events between %{from} and %{to}."
# app/views/mymodel/index.html.erb
<%= content_tag :p, t('texts.only_showing_between', :format => :month, :from => @listing[:from], :to => @listing[:to]), :class => 'text-muted' %>
但它似乎并没有应用自定义格式。任何有用的三分球,将不胜感激:)