Fixed plural/singular days (part of bug 622172)

This commit is contained in:
Kumar McMillan 2011-01-20 16:10:52 -06:00
Родитель c4c8aa6b39
Коммит 93ddd7f3ee
2 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -76,7 +76,9 @@ class ViewEditorQueueTable(tables.ModelTable):
row.hours_since_created)
else:
# L10n: first argument is number of days
r = _(u'%d days') % row.days_since_created
r = ngettext(u'{0} day', u'{0} days',
row.days_since_created).format(
row.days_since_created)
return jinja2.escape(r)
def render_flags(self, row):

Просмотреть файл

@ -63,6 +63,12 @@ class TestViewEditorQueueTable(test_utils.TestCase):
row.hours_since_created = 10 * 24
eq_(self.table.render_days_since_created(row), u'10 days')
def test_waiting_time_one_day(self):
row = Mock()
row.days_since_created = 1
row.hours_since_created = 24
eq_(self.table.render_days_since_created(row), u'1 day')
def test_waiting_time_in_hours(self):
row = Mock()
row.days_since_created = 0