Closed Bug 598029 Opened 14 years ago Closed 14 years ago

Fix "timesince" filter for locales unknown to Django

Categories

(Input :: General, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wenzel, Assigned: wenzel)

References

Details

(Whiteboard: [qa-])

If Django does not know a locale (like fy-NL), the "timesince" filter just shows English on our otherwise localized site. Need to figure out a way to fix this. Either by avoiding the timesince filter altogether and running something of our own (thus making it localizable) or some other method I haven't thought about yet.
Target Milestone: --- → 2.0
When you import the timesince filter as a helper, can't you monkeypatch something like:

defaultfilters._ = uggetext

that should force it to use our uggettext from tower, rather than django...
Hm, but that still wouldn't make the strings in "1 week, 4 days ago" show up in our translation file...?
Hrm, I suppose we can't just add them in somehow?
Priority: -- → P3
Assignee: nobody → fwenzel
Chowse also suggested to reduce the complexity of the timesince display to just the largest number ("1 week" as opposed to "1 week, 3 days", and "3 hours" as opposed to "3 hours 12 minutes"). That should greatly reduce the complexity here and make it easily localizable.

Chris: Should we go as high as months for the biggest possible interval, or do you want to keep weeks, which would result in displays like "73 weeks ago" when digging back in time?
(In reply to comment #4)
> Chris: Should we go as high as months for the biggest possible interval, or do
> you want to keep weeks, which would result in displays like "73 weeks ago" when
> digging back in time?

Given that feedback seems to have a shelf life of one beta cycle (~30 days), I don't think there's much need to provide more than one-day intervals.

I'm also partial to Twitter's approach: after a few days, give an absolute date instead of a relative timestamp. For example, if a comment is more than a week old, just use something like "01 Nov".
Code and test: http://github.com/fwenzel/reporter/commit/0aa0181

The limits are now:

< 1 minute: "just now"
minutes, hours, and days as expected
> 7 days: full localized date, as in: "Aug 28, 2010".
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [qa-]
Component: Input → General
Product: Webtools → Input
You need to log in before you can comment on or make changes to this bug.