From: Michael Tremer Date: Mon, 26 Oct 2015 17:15:12 +0000 (+0100) Subject: entropy: Localise plugin X-Git-Tag: 004~27 X-Git-Url: http://git.ipfire.org/?p=collecty.git;a=commitdiff_plain;h=971ad5c8dfce9f8bf2ada202e1b19c7f6f6dba48 entropy: Localise plugin Signed-off-by: Michael Tremer --- diff --git a/src/collecty/plugins/entropy.py b/src/collecty/plugins/entropy.py index 0b3fa5a..7dcb418 100644 --- a/src/collecty/plugins/entropy.py +++ b/src/collecty/plugins/entropy.py @@ -30,29 +30,35 @@ ENTROPY_FILE = "/proc/sys/kernel/random/entropy_avail" class GraphTemplateEntropy(base.GraphTemplate): name = "entropy" - rrd_graph = [ - "DEF:entropy=%(file)s:entropy:AVERAGE", - "CDEF:entropytrend=entropy,43200,TREND", - - "LINE3:entropy#ff0000:%-15s" % _("Available entropy"), - "VDEF:entrmin=entropy,MINIMUM", - "VDEF:entrmax=entropy,MAXIMUM", - "VDEF:entravg=entropy,AVERAGE", - "GPRINT:entrmax:%12s\:" % _("Maximum") + " %5.0lf", - "GPRINT:entrmin:%12s\:" % _("Minimum") + " %5.0lf", - "GPRINT:entravg:%12s\:" % _("Average") + " %5.0lf\\n", - - "LINE3:entropytrend#000000", - ] + @property + def rrd_graph(self): + _ = self.locale.translate + + return [ + "DEF:entropy=%(file)s:entropy:AVERAGE", + "CDEF:entropytrend=entropy,43200,TREND", + + "LINE3:entropy#ff0000:%-15s" % _("Available entropy"), + "VDEF:entrmin=entropy,MINIMUM", + "VDEF:entrmax=entropy,MAXIMUM", + "VDEF:entravg=entropy,AVERAGE", + "GPRINT:entrmax:%12s\:" % _("Maximum") + " %5.0lf", + "GPRINT:entrmin:%12s\:" % _("Minimum") + " %5.0lf", + "GPRINT:entravg:%12s\:" % _("Average") + " %5.0lf\\n", + + "LINE3:entropytrend#000000", + ] lower_limit = 0 @property def graph_title(self): + _ = self.locale.translate return _("Available entropy") @property def graph_vertical_label(self): + _ = self.locale.translate return _("Bit")