草庐IT

levenshtein-distance

全部标签

ruby-on-rails - Rails distance_of_time_in_words 返回 "en, about_x_hours"

我有一个奇怪的问题,希望有人知道问题是什么......使用distance_of_time_in_words(因此使用time_ago_in_words)不会返回实际时间距离。相反,它会返回诸如“en,about_x_hours”或“en,x_minutes”之类的内容。模式是正确的,如:time_ago_in_words(50.minutes.ago)=>"en,about_x_hours"time_ago_in_words(3.minutes.ago)=>"en,x_minutes"但到底为什么在所有这些的开头显示“x”而不是实际数字,“_”而不是空格,以及“en,”?!