mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
fix locale.format location
This commit is contained in:
parent
1648d254d6
commit
9fba248489
1 changed files with 5 additions and 5 deletions
|
@ -50,8 +50,8 @@ def fmtTimeSpan(time, pad=0, point=0, short=False):
|
||||||
fmt = shortTimeTable[type]
|
fmt = shortTimeTable[type]
|
||||||
else:
|
else:
|
||||||
fmt = timeTable[type](_pluralCount(round(time, point)))
|
fmt = timeTable[type](_pluralCount(round(time, point)))
|
||||||
timestr = locale.format("%(a)d.%(b)df", {'a': pad, 'b': point})
|
timestr = "%(a)d.%(b)df" % {'a': pad, 'b': point}
|
||||||
return ("%" + (fmt % timestr)) % time
|
return locale.format("%" + (fmt % timestr), time)
|
||||||
|
|
||||||
def fmtTimeSpanPair(time1, time2, short=False):
|
def fmtTimeSpanPair(time1, time2, short=False):
|
||||||
(type, point) = optimalPeriod(time1, 0)
|
(type, point) = optimalPeriod(time1, 0)
|
||||||
|
@ -62,10 +62,10 @@ def fmtTimeSpanPair(time1, time2, short=False):
|
||||||
fmt = shortTimeTable[type]
|
fmt = shortTimeTable[type]
|
||||||
else:
|
else:
|
||||||
fmt = timeTable[type](2)
|
fmt = timeTable[type](2)
|
||||||
timestr = locale.format("%(a)d.%(b)df", {'a': pad, 'b': point})
|
timestr = "%(a)d.%(b)df" % {'a': pad, 'b': point}
|
||||||
finalstr = "%s-%s" % (
|
finalstr = "%s-%s" % (
|
||||||
('%' + timestr) % time1,
|
locale.format('%' + timestr, time1),
|
||||||
('%' + timestr) % time2)
|
locale.format('%' + timestr, time2),)
|
||||||
return fmt % finalstr
|
return fmt % finalstr
|
||||||
|
|
||||||
def optimalPeriod(time, point):
|
def optimalPeriod(time, point):
|
||||||
|
|
Loading…
Reference in a new issue