ActionView DateHelper won't format certain numbers
I'm moving a system to a new server. The code is the same on both servers. What is differ开发者_如何学运维ent (and wrong) is the output from methods within DateHelper.
Both fine:
?> time_ago_in_words(Time.now)
=> "less than a minute"
?> time_ago_in_words(Time.now - 1.month)
=> "about 1 month"
Broken:
?> time_ago_in_words(Time.now - 15.days)
=> "¨¨count¼¼ days"
In the HTML this comes out as:
{{count}} days
What's up? There's no error messages and nothing in the log. Presumably I'm missing a gem, since it works on one server but not the other. But (if so) which gem?
Are your gem versions same on both systems? Interpolation variable format has changed from "{{count}}" to "%{count}" at some point. Especially check the i18n gem version.
Docs: http://guides.rubyonrails.org/i18n.html#interpolation
精彩评论