mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
if there is a period, always use the plural
This commit is contained in:
parent
9172c9b697
commit
ec263d0d63
1 changed files with 6 additions and 6 deletions
|
@ -64,9 +64,9 @@ def fmtTimeSpan(time, pad=0, point=0, short=False, after=False):
|
||||||
fmt = shortTimeTable[type]
|
fmt = shortTimeTable[type]
|
||||||
else:
|
else:
|
||||||
if after:
|
if after:
|
||||||
fmt = afterTimeTable[type](_pluralCount(round(time, point)))
|
fmt = afterTimeTable[type](_pluralCount(time, point))
|
||||||
else:
|
else:
|
||||||
fmt = timeTable[type](_pluralCount(round(time, point)))
|
fmt = timeTable[type](_pluralCount(time, point))
|
||||||
timestr = "%(a)d.%(b)df" % {'a': pad, 'b': point}
|
timestr = "%(a)d.%(b)df" % {'a': pad, 'b': point}
|
||||||
return locale.format_string("%" + (fmt % timestr), time)
|
return locale.format_string("%" + (fmt % timestr), time)
|
||||||
|
|
||||||
|
@ -103,10 +103,10 @@ def convertSecondsTo(seconds, type):
|
||||||
return seconds / 31536000.0
|
return seconds / 31536000.0
|
||||||
assert False
|
assert False
|
||||||
|
|
||||||
def _pluralCount(time):
|
def _pluralCount(time, point):
|
||||||
if round(time, 1) == 1:
|
if point:
|
||||||
return 1
|
return 2
|
||||||
return round(time, 1)
|
return round(time)
|
||||||
|
|
||||||
# Locale
|
# Locale
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
Loading…
Reference in a new issue