mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Merge branch 'master' of github.com:dae/anki
This commit is contained in:
commit
7b271381e8
3 changed files with 14 additions and 14 deletions
|
@ -166,8 +166,8 @@ from revlog where id > ? """+lim, (self.col.sched.dayCutoff-86400)*1000)
|
||||||
def bold(s):
|
def bold(s):
|
||||||
return "<b>"+str(s)+"</b>"
|
return "<b>"+str(s)+"</b>"
|
||||||
msgp1 = ngettext("<!--studied-->%d card", "<!--studied-->%d cards", cards) % cards
|
msgp1 = ngettext("<!--studied-->%d card", "<!--studied-->%d cards", cards) % cards
|
||||||
b += _("Studied %(a)s in %(b)s today.") % dict(
|
b += _("Studied %(a)s %(b)s today.") % dict(
|
||||||
a=bold(msgp1), b=bold(fmtTimeSpan(thetime, unit=1)))
|
a=bold(msgp1), b=bold(fmtTimeSpan(thetime, unit=1, inTime=True)))
|
||||||
# again/pass count
|
# again/pass count
|
||||||
b += "<br>" + _("Again count: %s") % bold(failed)
|
b += "<br>" + _("Again count: %s") % bold(failed)
|
||||||
if cards:
|
if cards:
|
||||||
|
|
|
@ -37,13 +37,13 @@ timeTable = {
|
||||||
"seconds": lambda n: ngettext("%s second", "%s seconds", n),
|
"seconds": lambda n: ngettext("%s second", "%s seconds", n),
|
||||||
}
|
}
|
||||||
|
|
||||||
afterTimeTable = {
|
inTimeTable = {
|
||||||
"years": lambda n: ngettext("%s year<!--after-->", "%s years<!--after-->", n),
|
"years": lambda n: ngettext("in %s year", "in %s years", n),
|
||||||
"months": lambda n: ngettext("%s month<!--after-->", "%s months<!--after-->", n),
|
"months": lambda n: ngettext("in %s month", "in %s months", n),
|
||||||
"days": lambda n: ngettext("%s day<!--after-->", "%s days<!--after-->", n),
|
"days": lambda n: ngettext("in %s day", "in %s days", n),
|
||||||
"hours": lambda n: ngettext("%s hour<!--after-->", "%s hours<!--after-->", n),
|
"hours": lambda n: ngettext("in %s hour", "in %s hours", n),
|
||||||
"minutes": lambda n: ngettext("%s minute<!--after-->", "%s minutes<!--after-->", n),
|
"minutes": lambda n: ngettext("in %s minute", "in %s minutes", n),
|
||||||
"seconds": lambda n: ngettext("%s second<!--after-->", "%s seconds<!--after-->", n),
|
"seconds": lambda n: ngettext("in %s second", "in %s seconds", n),
|
||||||
}
|
}
|
||||||
|
|
||||||
def shortTimeFmt(type):
|
def shortTimeFmt(type):
|
||||||
|
@ -56,7 +56,7 @@ def shortTimeFmt(type):
|
||||||
"seconds": _("%ss"),
|
"seconds": _("%ss"),
|
||||||
}[type]
|
}[type]
|
||||||
|
|
||||||
def fmtTimeSpan(time, pad=0, point=0, short=False, after=False, unit=99):
|
def fmtTimeSpan(time, pad=0, point=0, short=False, inTime=False, unit=99):
|
||||||
"Return a string representing a time span (eg '2 days')."
|
"Return a string representing a time span (eg '2 days')."
|
||||||
(type, point) = optimalPeriod(time, point, unit)
|
(type, point) = optimalPeriod(time, point, unit)
|
||||||
time = convertSecondsTo(time, type)
|
time = convertSecondsTo(time, type)
|
||||||
|
@ -65,8 +65,8 @@ def fmtTimeSpan(time, pad=0, point=0, short=False, after=False, unit=99):
|
||||||
if short:
|
if short:
|
||||||
fmt = shortTimeFmt(type)
|
fmt = shortTimeFmt(type)
|
||||||
else:
|
else:
|
||||||
if after:
|
if inTime:
|
||||||
fmt = afterTimeTable[type](_pluralCount(time, point))
|
fmt = inTimeTable[type](_pluralCount(time, point))
|
||||||
else:
|
else:
|
||||||
fmt = timeTable[type](_pluralCount(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}
|
||||||
|
|
|
@ -106,8 +106,8 @@ where id > ?""", (self.mw.col.sched.dayCutoff-86400)*1000)
|
||||||
cards = cards or 0
|
cards = cards or 0
|
||||||
thetime = thetime or 0
|
thetime = thetime or 0
|
||||||
msgp1 = ngettext("<!--studied-->%d card", "<!--studied-->%d cards", cards) % cards
|
msgp1 = ngettext("<!--studied-->%d card", "<!--studied-->%d cards", cards) % cards
|
||||||
buf = _("Studied %(a)s in %(b)s today.") % dict(a=msgp1,
|
buf = _("Studied %(a)s %(b)s today.") % dict(a=msgp1,
|
||||||
b=fmtTimeSpan(thetime, unit=1))
|
b=fmtTimeSpan(thetime, unit=1, inTime=True))
|
||||||
return buf
|
return buf
|
||||||
|
|
||||||
def _countWarn(self):
|
def _countWarn(self):
|
||||||
|
|
Loading…
Reference in a new issue