I’m having a weird problem, hoping someone knows what the issue is…
Using distance_of_time_in_words (and consequently time_ago_in_words) is not returning the actual time distance. Instead it is returning things like “en, about_x_hours” or “en, x_minutes”.
The pattern is correct, as in:
time_ago_in_words(50.minutes.ago) => "en, about_x_hours"
time_ago_in_words(3.minutes.ago) => "en, x_minutes"
But why on earth is it displaying “x” instead of the actual number, “_” instead of spaces, and “en, ” at the beginning of all of that?!
So I finally got it to work!! Hope this helps anyone who might have the same problem…
Basically half of what Lichtamberg first said was correct. The en.yml had to be as follows:
Note that
x_minutesis not underdatetimeand that it hasoneandother. Further, there is no need forI18n.las I18n is already implemented in thedistance_of_time_in_wordsmethod.So with the above (plus all the other about_x_hours, x_days, etc patterns that you can find on the file Lichtamberg included), just do:
And… voila!