# HG changeset patch # User Andrey Skvortsov # Date 1480606234 -10800 # Node ID b1be424015228820650e12841d65eea718b6268e # Parent e17406dd4f0612b91194c74b6a6da7733cad572a add i18n to PLC status Extra strings are added to the code to make mki18n.py to find these strings in source files and put them into i18n/messages.pot. diff -r e17406dd4f06 -r b1be42401522 ProjectController.py --- a/ProjectController.py Thu Dec 01 16:59:16 2016 +0300 +++ b/ProjectController.py Thu Dec 01 18:30:34 2016 +0300 @@ -1269,17 +1269,27 @@ updated = True self.AppFrame.RefreshStatusToolBar() if status == "Disconnected": - self.AppFrame.ConnectionStatusBar.SetStatusText(_(status), 1) + self.AppFrame.ConnectionStatusBar.SetStatusText(self.GetTextStatus(status), 1) self.AppFrame.ConnectionStatusBar.SetStatusText('', 2) else: self.AppFrame.ConnectionStatusBar.SetStatusText( _("Connected to URI: %s") % self.BeremizRoot.getURI_location().strip(), 1) - self.AppFrame.ConnectionStatusBar.SetStatusText(_(status), 2) + self.AppFrame.ConnectionStatusBar.SetStatusText(self.GetTextStatus(status), 2) return updated + def GetTextStatus(self, status): + msgs = { + "Started": _("Started"), + "Stopped": _("Stopped"), + "Empty": _("Empty"), + "Broken": _("Broken"), + "Disconnected": _("Disconnected") + } + return msgs.get(status, status) + def ShowPLCProgress(self, status = "", progress = 0): self.AppFrame.ProgressStatusBar.Show() - self.AppFrame.ConnectionStatusBar.SetStatusText(status, 1) + self.AppFrame.ConnectionStatusBar.SetStatusText(self.GetTextStatus(status), 1) self.AppFrame.ProgressStatusBar.SetValue(progress) def HidePLCProgress(self):