--- a/viewer.py Wed Jun 15 21:35:37 2016 +0800
+++ b/viewer.py Wed Jun 15 22:02:33 2016 +0800
parts.append(('#777', 62, 30.5, 'unknown'))
elif check.errors or check.warnings:
- w = 7 + 6 * len(str(check.errors)) + 7
- parts.append(('#da314b', w, w / 2 - 0.5, check.errors))
+ msg = self.locale.translate('{} error', '{} errors', check.errors)
+ text = msg.format(check.errors)
+ width = 7 + 6 * len(text) + 7
+ parts.append(('#da314b', width, width // 2 - 0.5, text))
- w = 7 + 6 * len(str(check.warnings)) + 7
- parts.append(('#faa732', w, w / 2 - 0.5, check.warnings))
+ msg = self.locale.translate('{} warning', '{} warnings', check.warnings)
+ text = msg.format(check.warnings)
+ width = 7 + 6 * len(text) + 9
+ parts.append(('#faa732', width, width // 2 + 0.5, text))
parts.append(('#8cc14c', 40, 19.5, 'none'))
width = sum(p[1] for p in parts)