Use fmtPercentage to respect current locale decimal point, and split into smaller strings

This commit is contained in:
Susanna Björverud 2009-03-24 13:27:13 +01:00 committed by Damien Elmes
parent 5c0c44fa0a
commit e9b88dddd6

View file

@ -189,31 +189,27 @@ class StatusView(object):
self.progressBar.setPalette(p) self.progressBar.setPalette(p)
self.progressBar.setValue(stats['dYesTotal%']) self.progressBar.setValue(stats['dYesTotal%'])
# tooltips # tooltips
stats['avgTime'] = anki.utils.fmtTimeSpan(stats['dAverageTime'], point=2) tip = "<h1>" + _("Performance") + "</h1>"
stats['revTime'] = anki.utils.fmtTimeSpan(stats['dReviewTime'], point=2) tip += _("""The top bar shows your performance today. The bottom bar shows your<br>
tip = _("""<h1>Performance</h1>
The top bar shows your performance today. The bottom bar shows your<br>
performance on cards scheduled for 21 days or more. The bottom bar should<br> performance on cards scheduled for 21 days or more. The bottom bar should<br>
generally be between 80-95%% - lower and you're forgetting mature cards<br> generally be between 80-95%% - lower and you're forgetting mature cards<br>
too often, higher and you're spending too much time reviewing. too often, higher and you're spending too much time reviewing.""")
<h2>Reviews today</h2> tip += "<h2>" + _("Reviews today") + "</h2>"
<b>Correct today: %(dYesTotal%)0.1f%% tip += "<b>" + _("Correct today: ") + anki.utils.fmtPercentage(stats['dYesTotal%'], point=1)
(%(dYesTotal)d of %(dTotal)d)</b><br> tip += " (" + _("%(partOf)d of %(totalSum)d") % {'partOf' : stats['dYesTotal'], 'totalSum' : stats['dTotal'] } + ")</b><br>"
Average time per answer: %(avgTime)s<br> tip += _("Average time per answer: ") + anki.utils.fmtTimeSpan(stats['dAverageTime'], point=2) +"<br>"
Total review time: %(revTime)s""") % stats tip += _("Total review time: ") + anki.utils.fmtTimeSpan(stats['dReviewTime'], point=2)
stats['avgTime'] = anki.utils.fmtTimeSpan(stats['gAverageTime'], point=2) tip += "<h2>" + _("All Reviews") + "</h2>"
stats['revTime'] = anki.utils.fmtTimeSpan(stats['gReviewTime'], point=2) tip += "<b>" + _("Correct over a month: ") + anki.utils.fmtPercentage(stats['gMatureYes%'], point=1)
tip += _("""<h2>All Reviews</h2> tip += " (" + _("%(partOf)d of %(totalSum)d") % {'partOf' : stats['gMatureYes'], 'totalSum' : stats['gMatureTotal'] } + ")</b><br>"
<b>Correct over a month: %(gMatureYes%)0.1f%% tip += _("Average time per answer: ") + anki.utils.fmtTimeSpan(stats['gAverageTime'], point=2) +"<br>"
(%(gMatureYes)d of %(gMatureTotal)d)</b><br> tip += _("Total review time: ") + anki.utils.fmtTimeSpan(stats['gReviewTime'], point=2) +"<br>"
Average time per answer: %(avgTime)s<br> tip += _("Correct under a month: ") + anki.utils.fmtPercentage(stats['gYoungYes%'], point=1)
Total review time: %(revTime)s<br> tip += " (" + _("%(partOf)d of %(totalSum)d") % {'partOf' : stats['gYoungYes'], 'totalSum' : stats['gYoungTotal'] } + ")</b><br>"
Correct under a month: %(gYoungYes%)0.1f%% tip += _("Correct first time: ") + anki.utils.fmtPercentage(stats['gNewYes%'], point=1)
(%(gYoungYes)d of %(gYoungTotal)d)<br> tip += " (" + _("%(partOf)d of %(totalSum)d") % {'partOf' : stats['gNewYes'], 'totalSum' : stats['gNewTotal'] } + ")</b><br>"
Correct first time: %(gNewYes%)0.1f%% tip += _("Total correct: ") + anki.utils.fmtPercentage(stats['gYesTotal%'], point=1)
(%(gNewYes)d of %(gNewTotal)d)<br> tip += " (" + _("%(partOf)d of %(totalSum)d") % {'partOf' : stats['gYesTotal'], 'totalSum' : stats['gTotal'] } + ")</b><br>"
Total correct: %(gYesTotal%)0.1f%%
(%(gYesTotal)d of %(gTotal)d)""") % stats
self.combinedBar.setToolTip(tip) self.combinedBar.setToolTip(tip)
if self.main.config['showTimer']: if self.main.config['showTimer']:
self.drawTimer() self.drawTimer()