]> git.ipfire.org Git - oddments/collecty.git/commitdiff
entropy: Localise plugin
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 26 Oct 2015 17:15:12 +0000 (18:15 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 26 Oct 2015 17:15:12 +0000 (18:15 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/collecty/plugins/entropy.py

index 0b3fa5af591abc8b7b14c17a30808f48b69a8aca..7dcb4184922f3d4a2523aa0b7eecdb5da683d838 100644 (file)
@@ -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")