Fixed plural/singular days (part of bug 622172)
This commit is contained in:
Родитель
c4c8aa6b39
Коммит
93ddd7f3ee
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче