# HG changeset patch # User laurent # Date 1248795799 -7200 # Node ID 331d698e1118261e5a0b71e09fc32474b0738348 # Parent 32339ad7d9ae46a8d194468fc4535e5afadc50eb Adding support for internationalization diff -r 32339ad7d9ae -r 331d698e1118 Beremiz.py --- a/Beremiz.py Mon Jul 20 16:28:56 2009 +0200 +++ b/Beremiz.py Tue Jul 28 17:43:19 2009 +0200 @@ -29,9 +29,10 @@ import shutil import random -_local_path = os.path.split(os.path.realpath(__file__))[0] +CWD = os.path.split(os.path.realpath(__file__))[0] + def Bpath(*args): - return os.path.join(_local_path,*args) + return os.path.join(CWD,*args) if __name__ == '__main__': def usage(): @@ -72,6 +73,33 @@ splash=wx.SplashScreen(bmp,wx.SPLASH_CENTRE_ON_SCREEN, 1000, None) wx.Yield() +# Import module for internationalization +import gettext +import __builtin__ + +# Get folder containing translation files +localedir = os.path.join(CWD,"locale") +# Get the default language +langid = wx.LANGUAGE_DEFAULT +# Define translation domain (name of translation files) +domain = "Beremiz" + +# Define locale for wx +loc = __builtin__.__dict__.get('loc', None) +if loc is None: + loc = wx.Locale(langid) + __builtin__.__dict__['loc'] = loc +# Define location for searching translation files +loc.AddCatalogLookupPathPrefix(localedir) +# Define locale domain +loc.AddCatalog(domain) + +def unicode_translation(message): + return wx.GetTranslation(message).encode("utf-8") + +if __name__ == '__main__': + __builtin__.__dict__['_'] = wx.GetTranslation#unicode_translation + import wx.lib.buttons, wx.lib.statbmp import TextCtrlAutoComplete, cPickle import types, time, re, platform, time, traceback, commands @@ -255,19 +283,19 @@ def _init_coll_FileMenu_Items(self, parent): parent.Append(help='', id=wx.ID_NEW, - kind=wx.ITEM_NORMAL, text=u'New\tCTRL+N') + kind=wx.ITEM_NORMAL, text=_(u'New\tCTRL+N')) parent.Append(help='', id=wx.ID_OPEN, - kind=wx.ITEM_NORMAL, text=u'Open\tCTRL+O') + kind=wx.ITEM_NORMAL, text=_(u'Open\tCTRL+O')) parent.Append(help='', id=wx.ID_SAVE, - kind=wx.ITEM_NORMAL, text=u'Save\tCTRL+S') + kind=wx.ITEM_NORMAL, text=_(u'Save\tCTRL+S')) parent.Append(help='', id=wx.ID_CLOSE_ALL, - kind=wx.ITEM_NORMAL, text=u'Close Project') + kind=wx.ITEM_NORMAL, text=_(u'Close Project')) parent.AppendSeparator() parent.Append(help='', id=wx.ID_PROPERTIES, - kind=wx.ITEM_NORMAL, text=u'Properties') + kind=wx.ITEM_NORMAL, text=_(u'Properties')) parent.AppendSeparator() parent.Append(help='', id=wx.ID_EXIT, - kind=wx.ITEM_NORMAL, text=u'Quit\tCTRL+Q') + kind=wx.ITEM_NORMAL, text=_(u'Quit\tCTRL+Q')) self.Bind(wx.EVT_MENU, self.OnNewProjectMenu, id=wx.ID_NEW) self.Bind(wx.EVT_MENU, self.OnOpenProjectMenu, id=wx.ID_OPEN) self.Bind(wx.EVT_MENU, self.OnSaveProjectMenu, id=wx.ID_SAVE) @@ -277,27 +305,27 @@ def _init_coll_EditMenu_Items(self, parent): parent.Append(help='', id=wx.ID_EDIT, - kind=wx.ITEM_NORMAL, text=u'Edit PLC\tCTRL+R') + kind=wx.ITEM_NORMAL, text=_(u'Edit PLC\tCTRL+R')) parent.AppendSeparator() parent.Append(help='', id=wx.ID_ADD, - kind=wx.ITEM_NORMAL, text=u'Add Plugin') + kind=wx.ITEM_NORMAL, text=_(u'Add Plugin')) parent.Append(help='', id=wx.ID_DELETE, - kind=wx.ITEM_NORMAL, text=u'Delete Plugin') + kind=wx.ITEM_NORMAL, text=_(u'Delete Plugin')) self.Bind(wx.EVT_MENU, self.OnEditPLCMenu, id=wx.ID_EDIT) self.Bind(wx.EVT_MENU, self.OnAddMenu, id=wx.ID_ADD) self.Bind(wx.EVT_MENU, self.OnDeleteMenu, id=wx.ID_DELETE) def _init_coll_RunMenu_Items(self, parent): parent.Append(help='', id=ID_BEREMIZRUNMENUBUILD, - kind=wx.ITEM_NORMAL, text=u'Build\tCTRL+R') + kind=wx.ITEM_NORMAL, text=_(u'Build\tCTRL+R')) parent.AppendSeparator() parent.Append(help='', id=ID_BEREMIZRUNMENUSIMULATE, - kind=wx.ITEM_NORMAL, text=u'Simulate') + kind=wx.ITEM_NORMAL, text=_(u'Simulate')) parent.Append(help='', id=ID_BEREMIZRUNMENURUN, - kind=wx.ITEM_NORMAL, text=u'Run') + kind=wx.ITEM_NORMAL, text=_(u'Run')) parent.AppendSeparator() parent.Append(help='', id=ID_BEREMIZRUNMENUSAVELOG, - kind=wx.ITEM_NORMAL, text=u'Save Log') + kind=wx.ITEM_NORMAL, text=_(u'Save Log')) self.Bind(wx.EVT_MENU, self.OnBuildMenu, id=ID_BEREMIZRUNMENUBUILD) self.Bind(wx.EVT_MENU, self.OnSimulateMenu, @@ -309,17 +337,17 @@ def _init_coll_HelpMenu_Items(self, parent): parent.Append(help='', id=wx.ID_HELP, - kind=wx.ITEM_NORMAL, text=u'Beremiz\tF1') + kind=wx.ITEM_NORMAL, text=_(u'Beremiz\tF1')) parent.Append(help='', id=wx.ID_ABOUT, - kind=wx.ITEM_NORMAL, text=u'About') + kind=wx.ITEM_NORMAL, text=_(u'About')) self.Bind(wx.EVT_MENU, self.OnBeremizMenu, id=wx.ID_HELP) self.Bind(wx.EVT_MENU, self.OnAboutMenu, id=wx.ID_ABOUT) def _init_coll_MenuBar_Menus(self, parent): - parent.Append(menu=self.FileMenu, title=u'File') + parent.Append(menu=self.FileMenu, title=_(u'File')) #parent.Append(menu=self.EditMenu, title=u'Edit') #parent.Append(menu=self.RunMenu, title=u'Run') - parent.Append(menu=self.HelpMenu, title=u'Help') + parent.Append(menu=self.HelpMenu, title=_(u'Help')) def _init_utils(self): self.MenuBar = wx.MenuBar() @@ -361,7 +389,7 @@ def _init_ctrls(self, prnt): wx.Frame.__init__(self, id=ID_BEREMIZ, name=u'Beremiz', parent=prnt, pos=wx.Point(0, 0), size=wx.Size(1000, 600), - style=wx.DEFAULT_FRAME_STYLE|wx.CLIP_CHILDREN, title=u'Beremiz') + style=wx.DEFAULT_FRAME_STYLE|wx.CLIP_CHILDREN, title=_(u'Beremiz')) self._init_utils() self.SetClientSize(wx.Size(1000, 600)) self.SetMenuBar(self.MenuBar) @@ -404,7 +432,7 @@ self.AUIManager.AddPane(self.PLCConfig, wx.aui.AuiPaneInfo().CenterPane()) self.AUIManager.AddPane(self.LogConsole, wx.aui.AuiPaneInfo(). - Caption("Log Console").Bottom().Layer(1). + Caption(_("Log Console")).Bottom().Layer(1). BestSize(wx.Size(800, 200)).CloseButton(False)) self.AUIManager.Update() @@ -492,8 +520,8 @@ if self.PluginRoot is not None: if self.PluginRoot.ProjectTestModified(): dialog = wx.MessageDialog(self, - "Save changes ?", - "Close Application", + _("Save changes ?"), + _("Close Application"), wx.YES_NO|wx.CANCEL|wx.ICON_QUESTION) answer = dialog.ShowModal() dialog.Destroy() @@ -581,7 +609,7 @@ addbutton = wx.lib.buttons.GenBitmapButton(id=addbutton_id, bitmap=wx.Bitmap(Bpath( 'images', 'Add.png')), name='AddPluginButton', parent=plcwindow, pos=wx.Point(0, 0), size=wx.Size(16, 16), style=wx.NO_BORDER) - addbutton.SetToolTipString("Add a sub plugin") + addbutton.SetToolTipString(_("Add a sub plugin")) addbutton.Bind(wx.EVT_BUTTON, self.Gen_AddPluginMenu(self.PluginRoot), id=addbutton_id) plcwindowsizer.AddWindow(addbutton, 0, border=5, flag=wx.RIGHT|wx.ALIGN_CENTER) @@ -677,7 +705,7 @@ for plugin_method in plugin.PluginMethods: if "method" in plugin_method and plugin_method.get("shown",True): id = wx.NewId() - label=plugin_method["name"] + label = plugin_method["name"] button = GenBitmapTextButton(id=id, parent=parent, bitmap=wx.Bitmap(Bpath( "%s.png"%plugin_method.get("bitmap", os.path.join("images", "Unknown")))), label=label, name=label, pos=wx.DefaultPosition, style=wx.NO_BORDER) @@ -784,7 +812,7 @@ enablebutton_id = wx.NewId() enablebutton = wx.lib.buttons.GenBitmapToggleButton(id=enablebutton_id, bitmap=wx.Bitmap(Bpath( 'images', 'Disabled.png')), name='EnableButton', parent=leftwindow, size=wx.Size(16, 16), pos=wx.Point(0, 0), style=0)#wx.NO_BORDER) - enablebutton.SetToolTipString("Enable/Disable this plugin") + enablebutton.SetToolTipString(_("Enable/Disable this plugin")) make_genbitmaptogglebutton_flat(enablebutton) enablebutton.SetBitmapSelected(wx.Bitmap(Bpath( 'images', 'Enabled.png'))) enablebutton.SetToggle(plugin.MandatoryParams[1].getEnabled()) @@ -834,7 +862,7 @@ deletebutton = wx.lib.buttons.GenBitmapButton(id=deletebutton_id, bitmap=wx.Bitmap(Bpath( 'images', 'Delete.png')), name='DeletePluginButton', parent=leftwindow, pos=wx.Point(0, 0), size=wx.Size(16, 16), style=wx.NO_BORDER) - deletebutton.SetToolTipString("Delete this plugin") + deletebutton.SetToolTipString(_("Delete this plugin")) deletebutton.Bind(wx.EVT_BUTTON, self.GetDeleteButtonFunction(plugin), id=deletebutton_id) adddeletesizer.AddWindow(deletebutton, 0, border=5, flag=wx.RIGHT|wx.ALIGN_CENTER) @@ -843,7 +871,7 @@ addbutton = wx.lib.buttons.GenBitmapButton(id=addbutton_id, bitmap=wx.Bitmap(Bpath( 'images', 'Add.png')), name='AddPluginButton', parent=leftwindow, pos=wx.Point(0, 0), size=wx.Size(16, 16), style=wx.NO_BORDER) - addbutton.SetToolTipString("Add a sub plugin") + addbutton.SetToolTipString(_("Add a sub plugin")) addbutton.Bind(wx.EVT_BUTTON, self.Gen_AddPluginMenu(plugin), id=addbutton_id) adddeletesizer.AddWindow(addbutton, 0, border=5, flag=wx.RIGHT|wx.ALIGN_CENTER) @@ -1025,7 +1053,7 @@ if len(plugin.PlugChildsTypes) > 0: for name, XSDClass, help in plugin.PlugChildsTypes: new_id = wx.NewId() - main_menu.Append(help=help, id=new_id, kind=wx.ITEM_NORMAL, text="Append "+help) + main_menu.Append(help=help, id=new_id, kind=wx.ITEM_NORMAL, text=_("Append ")+help) self.Bind(wx.EVT_MENU, self._GetAddPluginFunction(name, plugin), id=new_id) self.PopupMenuXY(main_menu) event.Skip() @@ -1110,7 +1138,8 @@ else: element_path = element_infos["name"] if element_infos["type"] == "element": - staticbox = wx.StaticBox(id=-1, label=element_infos["name"], + label = element_infos["name"] + staticbox = wx.StaticBox(id=-1, label=_(label), name='%s_staticbox'%element_infos["name"], parent=parent, pos=wx.Point(0, 0), size=wx.Size(10, 0), style=0) staticboxsizer = wx.StaticBoxSizer(staticbox, wx.VERTICAL) @@ -1130,10 +1159,11 @@ name="%s_bitmap"%element_infos["name"], parent=parent, pos=wx.Point(0, 0), size=wx.Size(24, 24), style=0) boxsizer.AddWindow(staticbitmap, 0, border=5, flag=wx.RIGHT) - statictext = wx.StaticText(id=-1, label="%s:"%element_infos["name"], + label = element_infos["name"] + statictext = wx.StaticText(id=-1, label="%s:"%_(label), name="%s_label"%element_infos["name"], parent=parent, - pos=wx.Point(0, 0), size=wx.Size(100, 17), style=0) - boxsizer.AddWindow(statictext, 0, border=4, flag=wx.TOP) + pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) + boxsizer.AddWindow(statictext, 0, border=5, flag=wx.ALIGN_CENTER_VERTICAL|wx.RIGHT) id = wx.NewId() if isinstance(element_infos["type"], types.ListType): combobox = wx.ComboBox(id=id, name=element_infos["name"], parent=parent, @@ -1144,7 +1174,9 @@ if len(element_infos["type"]) > 0 and isinstance(element_infos["type"][0], types.TupleType): for choice, xsdclass in element_infos["type"]: combobox.Append(choice) - staticbox = wx.StaticBox(id=-1, label="%(name)s - %(value)s"%element_infos, + name = element_infos["name"] + value = element_infos["value"] + staticbox = wx.StaticBox(id=-1, label="%s - %s"%(_(name), _(value)), name='%s_staticbox'%element_infos["name"], parent=parent, pos=wx.Point(0, 0), size=wx.Size(10, 0), style=0) staticboxsizer = wx.StaticBoxSizer(staticbox, wx.VERTICAL) @@ -1214,7 +1246,7 @@ else: defaultpath = config.Read("lastopenedfolder") - dialog = wx.DirDialog(self , "Choose a project", defaultpath, wx.DD_NEW_DIR_BUTTON) + dialog = wx.DirDialog(self , _("Choose a project"), defaultpath, wx.DD_NEW_DIR_BUTTON) if dialog.ShowModal() == wx.ID_OK: projectpath = dialog.GetPath() dialog.Destroy() @@ -1226,7 +1258,7 @@ self.RefreshAll() self.RefreshMainMenu() else: - message = wx.MessageDialog(self, res, "ERROR", wx.OK|wx.ICON_ERROR) + message = wx.MessageDialog(self, res, _("ERROR"), wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy() event.Skip() @@ -1237,7 +1269,7 @@ else: defaultpath = config.Read("lastopenedfolder") - dialog = wx.DirDialog(self , "Choose a project", defaultpath, wx.DD_NEW_DIR_BUTTON) + dialog = wx.DirDialog(self , _("Choose a project"), defaultpath, wx.DD_NEW_DIR_BUTTON) if dialog.ShowModal() == wx.ID_OK: projectpath = dialog.GetPath() if os.path.isdir(projectpath): @@ -1249,11 +1281,11 @@ self.RefreshAll() self.RefreshMainMenu() else: - message = wx.MessageDialog(self, result, "Error", wx.OK|wx.ICON_ERROR) + message = wx.MessageDialog(self, result, _("Error"), wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy() else: - message = wx.MessageDialog(self, "\"%s\" folder is not a valid Beremiz project\n"%projectpath, "Error", wx.OK|wx.ICON_ERROR) + message = wx.MessageDialog(self, _("\"%s\" folder is not a valid Beremiz project\n")%projectpath, _("Error"), wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy() dialog.Destroy() @@ -1263,8 +1295,8 @@ if self.PluginRoot is not None: if self.PluginRoot.ProjectTestModified(): dialog = wx.MessageDialog(self, - "Save changes ?", - "Close Application", + _("Save changes ?"), + _("Close Application"), wx.YES_NO|wx.CANCEL|wx.ICON_QUESTION) answer = dialog.ShowModal() dialog.Destroy() @@ -1322,7 +1354,7 @@ event.Skip() def OnAboutMenu(self, event): - OpenHtmlFrame(self,"About Beremiz", Bpath("doc","about.html"), wx.Size(550, 500)) + OpenHtmlFrame(self,_("About Beremiz"), Bpath("doc","about.html"), wx.Size(550, 500)) event.Skip() def OnAddButton(self, event): @@ -1355,7 +1387,7 @@ return DeleteButtonFunction def AddPlugin(self, PluginType, plugin): - dialog = wx.TextEntryDialog(self, "Please enter a name for plugin:", "Add Plugin", "", wx.OK|wx.CANCEL) + dialog = wx.TextEntryDialog(self, _("Please enter a name for plugin:"), _("Add Plugin"), "", wx.OK|wx.CANCEL) if dialog.ShowModal() == wx.ID_OK: PluginName = dialog.GetValue() plugin.PlugAddChild(PluginName, PluginType) @@ -1363,7 +1395,7 @@ dialog.Destroy() def DeletePlugin(self, plugin): - dialog = wx.MessageDialog(self, "Really delete plugin ?", "Remove plugin", wx.YES_NO|wx.NO_DEFAULT) + dialog = wx.MessageDialog(self, _("Really delete plugin ?"), _("Remove plugin"), wx.YES_NO|wx.NO_DEFAULT) if dialog.ShowModal() == wx.ID_YES: self.PluginInfos.pop(plugin) plugin.PlugRemove() @@ -1380,12 +1412,12 @@ def Display_Exception_Dialog(e_type, e_value, e_tb, bug_report_path): trcbck_lst = [] for i,line in enumerate(traceback.extract_tb(e_tb)): - trcbck = " " + str(i+1) + ". " + trcbck = " " + str(i+1) + _(". ") if line[0].find(os.getcwd()) == -1: - trcbck += "file : " + str(line[0]) + ", " + trcbck += _("file : ") + str(line[0]) + _(", ") else: - trcbck += "file : " + str(line[0][len(os.getcwd()):]) + ", " - trcbck += "line : " + str(line[1]) + ", " + "function : " + str(line[2]) + trcbck += _("file : ") + str(line[0][len(os.getcwd()):]) + _(", ") + trcbck += _("line : ") + str(line[1]) + _(", ") + _("function : ") + str(line[2]) trcbck_lst.append(trcbck) # Allow clicking.... @@ -1394,7 +1426,7 @@ cap.ReleaseMouse() dlg = wx.SingleChoiceDialog(None, - """ + _(""" An unhandled exception (bug) occured. Bug report saved at : (%s) @@ -1406,9 +1438,9 @@ You should now restart Beremiz. Traceback: -""" % bug_report_path + +""") % bug_report_path + str(e_type) + " : " + str(e_value), - "Error", + _("Error"), trcbck_lst) try: res = (dlg.ShowModal() == wx.ID_OK) @@ -1418,7 +1450,7 @@ return res def Display_Error_Dialog(e_value): - message = wxMessageDialog(None, str(e_value), "Error", wxOK|wxICON_ERROR) + message = wxMessageDialog(None, str(e_value), _("Error"), wxOK|wxICON_ERROR) message.ShowModal() message.Destroy() diff -r 32339ad7d9ae -r 331d698e1118 Beremiz_service.py --- a/Beremiz_service.py Mon Jul 20 16:28:56 2009 +0200 +++ b/Beremiz_service.py Tue Jul 28 17:43:19 2009 +0200 @@ -86,6 +86,10 @@ WorkingDir = os.getcwd() argv=[WorkingDir] +import __builtin__ +if __name__ == '__main__': + __builtin__.__dict__['_'] = lambda x: x + if enablewx: try: import wx, re @@ -96,6 +100,36 @@ havewx = False if havewx: + app=wx.App(redirect=False) + + # Import module for internationalization + import gettext + + CWD = os.path.split(os.path.realpath(__file__))[0] + + # Get folder containing translation files + localedir = os.path.join(CWD,"locale") + # Get the default language + langid = wx.LANGUAGE_DEFAULT + # Define translation domain (name of translation files) + domain = "Beremiz" + + # Define locale for wx + loc = __builtin__.__dict__.get('loc', None) + if loc is None: + loc = wx.Locale(langid) + __builtin__.__dict__['loc'] = loc + # Define location for searching translation files + loc.AddCatalogLookupPathPrefix(localedir) + # Define locale domain + loc.AddCatalog(domain) + + def unicode_translation(message): + return wx.GetTranslation(message).encode("utf-8") + + if __name__ == '__main__': + __builtin__.__dict__['_'] = wx.GetTranslation#unicode_translation + try: from wx.lib.embeddedimage import PyEmbeddedImage except: @@ -226,7 +260,7 @@ texts = {"value" : value} for function, message in self.Tests: if not function(value): - message = wx.MessageDialog(self, message%texts, "Error", wx.OK|wx.ICON_ERROR) + message = wx.MessageDialog(self, message%texts, _("Error"), wx.OK|wx.ICON_ERROR) message.ShowModal() message.Destroy() return @@ -275,16 +309,16 @@ the base class takes care of the rest. """ menu = wx.Menu() - menu.Append(self.TBMENU_START, "Start PLC") - menu.Append(self.TBMENU_STOP, "Stop PLC") - menu.Append(self.TBMENU_CHANGE_NAME, "Change Name") - menu.Append(self.TBMENU_CHANGE_INTERFACE, "Change IP of interface to bind") - menu.Append(self.TBMENU_LIVE_SHELL, "Launch a live Python shell") - menu.Append(self.TBMENU_WXINSPECTOR, "Launch WX GUI inspector") - menu.Append(self.TBMENU_CHANGE_PORT, "Change Port Number") + menu.Append(self.TBMENU_START, _("Start PLC")) + menu.Append(self.TBMENU_STOP, _("Stop PLC")) + menu.Append(self.TBMENU_CHANGE_NAME, _("Change Name")) + menu.Append(self.TBMENU_CHANGE_INTERFACE, _("Change IP of interface to bind")) + menu.Append(self.TBMENU_LIVE_SHELL, _("Launch a live Python shell")) + menu.Append(self.TBMENU_WXINSPECTOR, _("Launch WX GUI inspector")) + menu.Append(self.TBMENU_CHANGE_PORT, _("Change Port Number")) menu.AppendSeparator() - menu.Append(self.TBMENU_CHANGE_WD, "Change working directory") - menu.Append(self.TBMENU_QUIT, "Quit") + menu.Append(self.TBMENU_CHANGE_WD, _("Change working directory")) + menu.Append(self.TBMENU_QUIT, _("Quit")) return menu def MakeIcon(self, img): @@ -311,9 +345,9 @@ evt.Skip() def OnTaskBarChangeInterface(self, evt): - dlg = ParamsEntryDialog(None, "Enter the ip of the interface to bind", defaultValue=self.pyroserver.ip) - dlg.SetTests([(re.compile('\d{1,3}(?:\.\d{1,3}){3}$').match, "Ip is not valid!"), - ( lambda ip :len([x for x in ip.split(".") if 0 <= int(x) <= 255]) == 4, "Ip is not valid!") + dlg = ParamsEntryDialog(None, _("Enter the ip of the interface to bind"), defaultValue=self.pyroserver.ip) + dlg.SetTests([(re.compile('\d{1,3}(?:\.\d{1,3}){3}$').match, _("Ip is not valid!")), + ( lambda ip :len([x for x in ip.split(".") if 0 <= int(x) <= 255]) == 4, _("Ip is not valid!")) ]) if dlg.ShowModal() == wx.ID_OK: self.pyroserver.ip = dlg.GetValue() @@ -321,23 +355,23 @@ evt.Skip() def OnTaskBarChangePort(self, evt): - dlg = ParamsEntryDialog(None, "Enter a port number ", defaultValue=str(self.pyroserver.port)) - dlg.SetTests([(UnicodeType.isdigit, "Port number must be an integer!"), (lambda port : 0 <= int(port) <= 65535 , "Port number must be 0 <= port <= 65535!")]) + dlg = ParamsEntryDialog(None, _("Enter a port number "), defaultValue=str(self.pyroserver.port)) + dlg.SetTests([(UnicodeType.isdigit, _("Port number must be an integer!")), (lambda port : 0 <= int(port) <= 65535 , _("Port number must be 0 <= port <= 65535!"))]) if dlg.ShowModal() == wx.ID_OK: self.pyroserver.port = int(dlg.GetValue()) self.pyroserver.Stop() evt.Skip() def OnTaskBarChangeWorkingDir(self, evt): - dlg = wx.DirDialog(None, "Choose a working directory ", self.pyroserver.workdir, wx.DD_NEW_DIR_BUTTON) + dlg = wx.DirDialog(None, _("Choose a working directory "), self.pyroserver.workdir, wx.DD_NEW_DIR_BUTTON) if dlg.ShowModal() == wx.ID_OK: self.pyroserver.workdir = dlg.GetPath() self.pyroserver.Stop() evt.Skip() def OnTaskBarChangeName(self, evt): - dlg = ParamsEntryDialog(None, "Enter a name ", defaultValue=self.pyroserver.name) - dlg.SetTests([(lambda name : len(name) is not 0 , "Name must not be null!")]) + dlg = ParamsEntryDialog(None, _("Enter a name "), defaultValue=self.pyroserver.name) + dlg.SetTests([(lambda name : len(name) is not 0 , _("Name must not be null!"))]) if dlg.ShowModal() == wx.ID_OK: self.pyroserver.name = dlg.GetValue() self.pyroserver.Restart() @@ -350,7 +384,7 @@ frame = py.crust.CrustFrame(locals=self.pyroserver.plcobj.python_threads_vars) frame.Show() else: - wx.MessageBox("No runnning PLC","Error") + wx.MessageBox(_("No runnning PLC"), _("Error")) evt.Skip() def OnTaskBarWXInspector(self, evt): diff -r 32339ad7d9ae -r 331d698e1118 Zeroconf.py --- a/Zeroconf.py Mon Jul 20 16:28:56 2009 +0200 +++ b/Zeroconf.py Tue Jul 28 17:43:19 2009 +0200 @@ -596,10 +596,10 @@ next = off + 1 off = ((len & 0x3F) << 8) | ord(self.data[off]) if off >= first: - raise "Bad domain name (circular) at " + str(off) + raise _("Bad domain name (circular) at ") + str(off) first = off else: - raise "Bad domain name at " + str(off) + raise _("Bad domain name at ") + str(off) if next >= 0: self.offset = next diff -r 32339ad7d9ae -r 331d698e1118 connectors/PYRO/__init__.py --- a/connectors/PYRO/__init__.py Mon Jul 20 16:28:56 2009 +0200 +++ b/connectors/PYRO/__init__.py Tue Jul 28 17:43:19 2009 +0200 @@ -28,7 +28,7 @@ """ This returns the connector to Pyro style PLCobject """ - pluginsroot.logger.write("Connecting to URI : %s\n"%uri) + pluginsroot.logger.write(_("Connecting to URI : %s\n")%uri) servicetype, location = uri.split("://") @@ -36,7 +36,7 @@ try : RemotePLCObjectProxy = pyro.getAttrProxyForURI("PYROLOC://"+location+"/PLCObject") except Exception, msg: - pluginsroot.logger.write_error("Wrong URI, please check it !\n") + pluginsroot.logger.write_error(_("Wrong URI, please check it !\n")) pluginsroot.logger.write_error(traceback.format_exc()) return None @@ -58,7 +58,7 @@ # Check connection is effective. # lambda is for getattr of GetPLCstatus to happen inside catcher if PyroCatcher(lambda:RemotePLCObjectProxy.GetPLCstatus())() == None: - pluginsroot.logger.write_error("Cannot get PLC status - connection failed.\n") + pluginsroot.logger.write_error(_("Cannot get PLC status - connection failed.\n")) return None @@ -90,7 +90,7 @@ Some bad libs with static symbols may polute PLC ask runtime to suicide and come back again """ - pluginsroot.logger.write("Force runtime reload\n") + pluginsroot.logger.write(_("Force runtime reload\n")) pluginsroot._connector.GetPyroProxy().ForceReload() pluginsroot._Disconnect() # let remote PLC time to resurect.(freeze app) diff -r 32339ad7d9ae -r 331d698e1118 discovery.py --- a/discovery.py Mon Jul 20 16:28:56 2009 +0200 +++ b/discovery.py Tue Jul 28 17:43:19 2009 +0200 @@ -34,7 +34,7 @@ listmix.ListCtrlAutoWidthMixin.__init__(self) class DiscoveryDialog(wx.Dialog, listmix.ColumnSorterMixin): - def __init__(self, parent, id=-1, title='Service Discovery'): + def __init__(self, parent, id=-1, title=_('Service Discovery')): self.my_result=None wx.Dialog.__init__(self, parent, id, title, size=(600,600), style=wx.DEFAULT_DIALOG_STYLE) @@ -61,7 +61,7 @@ self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, self.list) local_id = wx.NewId() - b = wx.Button(self, local_id, "Refresh") + b = wx.Button(self, local_id, _("Refresh")) self.Bind(wx.EVT_BUTTON, self.OnRefreshButton, b) btsizer.Add(b) @@ -69,18 +69,18 @@ btsizer.AddGrowableCol(1) local_id = wx.NewId() - b = wx.Button(self, local_id, "Local") + b = wx.Button(self, local_id, _("Local")) self.Bind(wx.EVT_BUTTON, self.ChooseLocalID, b) btsizer.Add(b) btsizer.AddSpacer(0) btsizer.AddGrowableCol(3) - b = wx.Button(self, wx.ID_CANCEL, "Cancel") + b = wx.Button(self, wx.ID_CANCEL, _("Cancel")) self.Bind(wx.EVT_BUTTON, self.OnCancel, b) btsizer.Add(b) - b = wx.Button(self, wx.ID_OK, "OK") + b = wx.Button(self, wx.ID_OK, _("OK")) self.Bind(wx.EVT_BUTTON, self.OnOk, b) b.SetDefault() btsizer.Add(b) diff -r 32339ad7d9ae -r 331d698e1118 i18n/Beremiz_fr_FR.po --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/i18n/Beremiz_fr_FR.po Tue Jul 28 17:43:19 2009 +0200 @@ -0,0 +1,954 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-06-24 18:44+0200\n" +"PO-Revision-Date: 2009-07-02 18:53+0100\n" +"Last-Translator: \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: Beremiz.py:1429 +#, python-format +msgid "" +"\n" +"An unhandled exception (bug) occured. Bug report saved at :\n" +"(%s)\n" +"\n" +"Please contact LOLITech at:\n" +"+33 (0)3 29 57 60 42\n" +"or please be kind enough to send this file to:\n" +"bugs_beremiz@lolitech.fr\n" +"\n" +"You should now restart Beremiz.\n" +"\n" +"Traceback:\n" +msgstr "" +"\n" +"Une erreur inconnue (bug) est apparu. Le rapport d'erreur a été sauvé dans :\n" +"(%s)\n" +"\n" +"Veuillez contacter LOLITech au :\n" +"+33 (0)3 29 57 60 42\n" +"ou envoyez ce fichier à l'adresse :\n" +"bugs_beremiz@lolitech.fr\n" +"\n" +"Vous devriez redémarrer Beremiz.\n" +"\n" +"Origine :\n" + +#: plugger.py:1332 +msgid " generation failed !\n" +msgstr ": la construction a échouée !\n" + +#: Beremiz.py:1288 +#, python-format +msgid "\"%s\" folder is not a valid Beremiz project\n" +msgstr "Le dossier \"%s\" ne contient pas de projet Beremiz valide\n" + +#: Beremiz_service.py:467 +#: runtime/PLCObject.py:269 +msgid "#EXCEPTION : " +msgstr "#EXCEPTION : " + +#: Beremiz.py:1417 +#: Beremiz.py:1419 +#: Beremiz.py:1420 +msgid ", " +msgstr ", " + +#: Beremiz.py:1415 +msgid ". " +msgstr ". " + +#: plugger.py:395 +#, python-format +msgid "A child names \"%s\" already exist -> \"%s\"\n" +msgstr "" + +#: plugger.py:427 +#, python-format +msgid "A child with IEC channel %d already exist -> %d\n" +msgstr "" + +#: Beremiz.py:342 +msgid "About" +msgstr "A propos" + +#: Beremiz.py:1357 +msgid "About Beremiz" +msgstr "A propos de Beremiz" + +#: Beremiz.py:311 +#: Beremiz.py:1390 +msgid "Add Plugin" +msgstr "Ajouter un plugin" + +#: Beremiz.py:612 +#: Beremiz.py:874 +msgid "Add a sub plugin" +msgstr "Ajouter un sous plugin" + +#: plugger.py:1680 +msgid "Already connected. Please disconnect\n" +msgstr "Déjà connecté. Veuillez déconnecter\n" + +#: Beremiz.py:1056 +msgid "Append " +msgstr "Ajouter " + +#: plugins/canfestival/config_utils.py:341 +#: plugins/canfestival/config_utils.py:623 +#, python-format +msgid "Bad location size : %s" +msgstr "Mauvaise taille d'adresse : %s" + +#: Beremiz.py:392 +msgid "Beremiz" +msgstr "Beremiz" + +#: Beremiz.py:340 +msgid "Beremiz\tF1" +msgstr "Beremiz\tF1" + +#: plugger.py:1464 +msgid "Broken" +msgstr "Cassé" + +#: plugger.py:1800 +msgid "Build" +msgstr "Compiler" + +#: Beremiz.py:320 +msgid "Build\tCTRL+R" +msgstr "Compiler\tCTRL+R" + +#: plugger.py:1434 +msgid "Build directory already clean\n" +msgstr "Le répertoire de compilation est déjà nettoyé\n" + +#: plugger.py:1801 +msgid "Build project into build folder" +msgstr "Compiler le projet dans le répertoire ce compilation" + +#: plugger.py:1350 +msgid "C Build crashed !\n" +msgstr "La compilation du C a mal fonctionné !\n" + +#: plugger.py:1347 +msgid "C Build failed.\n" +msgstr "La compilation du C a échouée !\n" + +#: plugger.py:1336 +msgid "C code generated successfully.\n" +msgstr "Code C généré avec succès.\n" + +#: targets/toolchain_gcc.py:119 +#, python-format +msgid "C compilation of %s failed.\n" +msgstr "La compilation C de %s a échouée.\n" + +#: plugger.py:1037 +#, python-format +msgid "Can't find module for target %s!\n" +msgstr "Impossible de trouver le module correspondant à la cible %s !\n" + +#: discovery.py:79 +msgid "Cancel" +msgstr "Annuler" + +#: plugger.py:1746 +msgid "Cannot compare latest build to target. Please build.\n" +msgstr "Impossible de comparer la cible avec la dernière compilation. Veuillez compiler le projet.\n" + +#: plugger.py:465 +#, python-format +msgid "Cannot create child %s of type %s " +msgstr "Impossible d'ajouter un élément \"%s\" de type \"%s\"" + +#: plugger.py:420 +#, python-format +msgid "Cannot find lower free IEC channel than %d\n" +msgstr "Impossible de trouver un numéro IEC inférieur à %d libre\n" + +#: connectors/PYRO/__init__.py:61 +msgid "Cannot get PLC status - connection failed.\n" +msgstr "Impossible d'obtenir le statut de l'automate - la connecxion a échoué.\n" + +#: plugger.py:1161 +msgid "Cannot open/parse VARIABLES.csv!\n" +msgstr "Impossible d'ouvrir ou d'analyser le fichier VARIABLES.csv !\n" + +#: plugins/canfestival/config_utils.py:371 +#, python-format +msgid "Cannot set bit offset for non bool '%s' variable (ID:%d,Idx:%x,sIdx:%x))" +msgstr "" + +#: Beremiz_service.py:281 +msgid "Change IP of interface to bind" +msgstr "Changer l'adresse IP de l'interface à lier" + +#: Beremiz_service.py:280 +msgid "Change Name" +msgstr "Changer le nom" + +#: Beremiz_service.py:284 +msgid "Change Port Number" +msgstr "Changer le numéro de port" + +#: Beremiz_service.py:286 +msgid "Change working directory" +msgstr "Changer le dossier de travail" + +#: Beremiz.py:1249 +#: Beremiz.py:1272 +msgid "Choose a project" +msgstr "Choisissez un projet" + +#: Beremiz_service.py:332 +msgid "Choose a working directory " +msgstr "Choisissez un dossier de travail" + +#: plugger.py:1804 +msgid "Clean" +msgstr "Nettoyer" + +#: plugger.py:1806 +msgid "Clean project build folder" +msgstr "Nettoyer le répertoire de compilation" + +#: plugger.py:1431 +msgid "Cleaning the build directory\n" +msgstr "Répertoire de compilation en cours de nettoyage\n" + +#: Beremiz.py:524 +#: Beremiz.py:1299 +msgid "Close Application" +msgstr "Fermer l'application" + +#: Beremiz.py:292 +msgid "Close Project" +msgstr "Fermer le projet" + +#: plugger.py:963 +msgid "Compiling IEC Program in to C code...\n" +msgstr "Compilation du program en IEC vers du code C en cours...\n" + +#: plugins/canfestival/config_utils.py:335 +#: plugins/canfestival/config_utils.py:617 +#, python-format +msgid "Conflict type for location \"%s\"" +msgstr "Conflit entre types pour l'adresse \"%s\"" + +#: plugger.py:1828 +msgid "Connect" +msgstr "Connecter" + +#: plugger.py:1829 +msgid "Connect to the target PLC" +msgstr "Connecter à l'automate cible" + +#: connectors/PYRO/__init__.py:31 +#, python-format +msgid "Connecting to URI : %s\n" +msgstr "Connection à l'URI %s en cours...\n" + +#: plugger.py:1713 +#, python-format +msgid "Connection failed to %s!\n" +msgstr "La connection à \"%s\" a échouée !\n" + +#: plugger.py:581 +#, python-format +msgid "" +"Could not add child \"%s\", type %s :\n" +"%s\n" +msgstr "" + +#: plugger.py:558 +#, python-format +msgid "" +"Couldn't load plugin base parameters %s :\n" +" %s" +msgstr "" +"Impossible de charger les paramètres de base du plugin %s :\n" +" %s" + +#: plugger.py:569 +#, python-format +msgid "" +"Couldn't load plugin parameters %s :\n" +" %s" +msgstr "" +"Impossible de charger les paramètres du plugin %s :\n" +" %s" + +#: plugger.py:1644 +msgid "Couldn't start PLC debug !\n" +msgstr "Impossible d'arrêter le débogage de l'automate !\n" + +#: plugger.py:1674 +msgid "Couldn't stop PLC !\n" +msgstr "Impossible d'arrêter l'automate !\n" + +#: plugger.py:1814 +msgid "Debug" +msgstr "Déboguer" + +#: plugger.py:1514 +#, python-format +msgid "Debug : Unknown variable %s\n" +msgstr "Débogage : variable \"%s\" inconnue\n" + +#: plugger.py:1622 +msgid "Debug Thread couldn't be killed" +msgstr "Le thread de débogage n'a pu être détruit" + +#: plugger.py:1609 +#, python-format +msgid "Debug data not coherent %d != %d\n" +msgstr "Les données de débogage ne sont pas cohérentes %d != %d\n" + +#: runtime/PLCObject.py:424 +#, python-format +msgid "Debug error idx : %d, expected_idx %d, type : %s" +msgstr "" + +#: plugger.py:1614 +msgid "Debugger disabled\n" +msgstr "Débogueur désactivé\n" + +#: Beremiz.py:313 +msgid "Delete Plugin" +msgstr "Supprimer un plugin" + +#: Beremiz.py:865 +msgid "Delete this plugin" +msgstr "Supprimer ce plugin" + +#: plugger.py:1461 +msgid "Dirty" +msgstr "Corrompu" + +#: plugger.py:1837 +msgid "Disconnect" +msgstr "Déconnecter" + +#: plugger.py:1839 +msgid "Disconnect from PLC" +msgstr "Déconnecter l'automate" + +#: plugger.py:1467 +msgid "Disconnected" +msgstr "Déconnecté" + +#: PythonSTC.py:576 +msgid "Do you want to continue?" +msgstr "Voulez-vous continuer ?" + +#: Beremiz.py:1261 +msgid "ERROR" +msgstr "ERREUR" + +#: plugins/c_ext/c_ext.py:204 +#: plugins/c_ext/c_ext.py:205 +msgid "Edit C File" +msgstr "Editer le fichier C" + +#: plugins/canfestival/canfestival.py:200 +msgid "Edit CanOpen Network with NetworkEdit" +msgstr "Editer le réseau CANOpen à l'aide de NetworkEdit" + +#: plugger.py:1796 +msgid "Edit PLC" +msgstr "Editer l'automate" + +#: Beremiz.py:308 +msgid "Edit PLC\tCTRL+R" +msgstr "Editer l'automate\tCTRL+R" + +#: plugger.py:1797 +msgid "Edit PLC program with PLCOpenEditor" +msgstr "Editer le programme à l'aide de PLCOpenEditor" + +#: plugger.py:1856 +msgid "Edit a WxWidgets GUI with WXGlade" +msgstr "Editer une IHM WxWidgets à l'aide de WXGlade" + +#: plugins/canfestival/canfestival.py:199 +msgid "Edit network" +msgstr "Editer le réseau" + +#: plugger.py:1848 +msgid "Edit raw IEC code added to code generated by PLCGenerator" +msgstr "Editer le code IEC ajouté au code généré par PLCGenerator" + +#: plugger.py:1458 +msgid "Empty" +msgstr "Vide" + +#: Beremiz.py:815 +msgid "Enable/Disable this plugin" +msgstr "Activer/Désactiver le plugin" + +#: Beremiz_service.py:339 +msgid "Enter a name " +msgstr "Saisissez un nom" + +#: Beremiz_service.py:324 +msgid "Enter a port number " +msgstr "Saisissez un numéro de port" + +#: Beremiz_service.py:314 +msgid "Enter the ip of the interface to bind" +msgstr "Saisissez l'adresse IP de l'interface à lier" + +#: Beremiz.py:1284 +#: Beremiz.py:1288 +#: Beremiz.py:1443 +#: Beremiz.py:1453 +#: Beremiz_service.py:229 +#: Beremiz_service.py:353 +msgid "Error" +msgstr "Erreur" + +#: plugger.py:1010 +msgid "Error : At least one configuration and one ressource must be declared in PLC !\n" +msgstr "Erreur : Au moins une configuration ou une resource doit être déclaré dans l'automate !\n" + +#: plugger.py:1002 +#, python-format +msgid "Error : IEC to C compiler returned %d\n" +msgstr "Erreur : Le compilateur d'IEC en C a retourné %d\n" + +#: plugger.py:941 +#, python-format +msgid "" +"Error in ST/IL/SFC code generator :\n" +"%s\n" +msgstr "" +"Erreur dans le générateur de code ST/IL/SFC :\n" +"%s\n" + +#: plugger.py:202 +#, python-format +msgid "Error while saving \"%s\"\n" +msgstr "Erreur lors de l'enregistrement de \"%s\"\n" + +#: plugins/canfestival/canfestival.py:191 +msgid "Error: No Master generated\n" +msgstr "Erreur : Aucun maître généré\n" + +#: plugins/canfestival/canfestival.py:186 +msgid "Error: No PLC built\n" +msgstr "Erreur : Aucun automate compilé\n" + +#: plugger.py:1707 +#, python-format +msgid "Exception while connecting %s!\n" +msgstr "Une exception est apparu au cours de la connexion %s !\n" + +#: plugger.py:1014 +msgid "Extracting Located Variables...\n" +msgstr "Extraction des variables adressées en cours...\n" + +#: plugger.py:1761 +msgid "Failed : Must build before transfer.\n" +msgstr "Echec : Le projet doit être compilé avant d'être transféré.\n" + +#: plugger.py:1341 +msgid "Fatal : cannot get builder.\n" +msgstr "Erreur fatale : impossible de trouver un compilateur.\n" + +#: Beremiz.py:347 +msgid "File" +msgstr "Fichier" + +#: plugger.py:815 +msgid "Folder choosen doesn't contain a program. It's not a valid project!" +msgstr "Le répertoire ne contient pas de programme. Ce n'est pas un projet valide !" + +#: plugger.py:780 +msgid "Folder choosen isn't empty. You can't use it for a new project!" +msgstr "Le répertoire n'est pas vide. Vous ne pouvez pas l'utiliser pour créer un nouveau projet !" + +#: connectors/PYRO/__init__.py:93 +msgid "Force runtime reload\n" +msgstr "Redémarrage du runtime forcé\n" + +#: plugger.py:931 +msgid "Generating SoftPLC IEC-61131 ST/IL/SFC code...\n" +msgstr "Création du code ST/IL/SFC de l'automate IEC-61131 en cours...\n" + +#: plugger.py:1289 +msgid "Generating plugins C code\n" +msgstr "Création du code C des plugins en cours\n" + +#: Beremiz.py:350 +msgid "Help" +msgstr "Aide" + +#: plugger.py:1281 +msgid "IEC-61131-3 code generation failed !\n" +msgstr "La création du code IEC-61131-3 a échouée !\n" + +#: plugins/canfestival/config_utils.py:376 +#: plugins/canfestival/config_utils.py:637 +#, python-format +msgid "Invalid type \"%s\"-> %d != %d for location\"%s\"" +msgstr "Type invalide \"%s\"-> %d != %d pour cette adresse \"%s\"" + +#: Beremiz_service.py:315 +#: Beremiz_service.py:316 +msgid "Ip is not valid!" +msgstr "l'IP est invalide !" + +#: plugger.py:1767 +msgid "Latest build already match current target. Transfering anyway...\n" +msgstr "La dernière compilation correspond à la cible actuelle...\n" + +#: plugger.py:1737 +msgid "Latest build do not match with target, please transfer.\n" +msgstr "La dernière compilation ne correspond pas a la cible actuelle, veuillez transférer le programme.\n" + +#: plugger.py:1741 +msgid "Latest build match target, no transfer needed.\n" +msgstr "La dernière compilation correspond à la cible actuelle. il n'est pas nécessaire de transférer le programme.\n" + +#: Beremiz_service.py:283 +msgid "Launch WX GUI inspector" +msgstr "Lancer un inspecteur d'IHM WX" + +#: Beremiz_service.py:282 +msgid "Launch a live Python shell" +msgstr "Lancer une console Python" + +#: targets/toolchain_gcc.py:127 +msgid "Linking :\n" +msgstr "Linkage :\n" + +#: discovery.py:72 +msgid "Local" +msgstr "Local" + +#: Beremiz.py:435 +msgid "Log Console" +msgstr "Console de log" + +#: plugger.py:475 +#, python-format +msgid "Max count (%d) reached for this plugin of type %s " +msgstr "Nombre limite(%d) atteint pour les plugin de type %s" + +#: runtime/ServicePublisher.py:50 +msgid "My IP is :" +msgstr "Mon IP est :" + +#: Beremiz_service.py:340 +msgid "Name must not be null!" +msgstr "Le nom ne doit pas être vide !" + +#: Beremiz.py:286 +msgid "New\tCTRL+N" +msgstr "Nouveau\tCTRL+N" + +#: runtime/PLCObject.py:313 +#, python-format +msgid "NewPLC (%s)" +msgstr "Nouvel automate (%s)" + +#: plugger.py:1791 +msgid "No PLC to transfer (did build success ?)\n" +msgstr "Aucun automate à transférer (la compilation a-t-elle réussi ?)\n" + +#: Beremiz_service.py:353 +msgid "No runnning PLC" +msgstr "Aucun automate en cours d'exécution" + +#: plugins/canfestival/config_utils.py:632 +#, python-format +msgid "No such index/subindex (%x,%x) (variable %s)" +msgstr "indice et sous-indice inconnu (%x,%x) (variable %s)" + +#: plugins/canfestival/config_utils.py:361 +#, python-format +msgid "No such index/subindex (%x,%x) in ID : %d (variable %s)" +msgstr "indice et sous-indice inconnu (%x,%x) pour l'ID : %d (variable %s)" + +#: plugins/canfestival/config_utils.py:354 +#, python-format +msgid "Non existing node ID : %d (variable %s)" +msgstr "Le node ID n'existe pas : %d (variable %s)" + +#: plugins/canfestival/config_utils.py:383 +#, python-format +msgid "Not PDO mappable variable : '%s' (ID:%d,Idx:%x,sIdx:%x))" +msgstr "Variable non mappable dans un PDO : '%s' (ID:%d,Idx:%x,sIdx:%x))" + +#: discovery.py:83 +msgid "OK" +msgstr "Valider" + +#: Beremiz.py:288 +msgid "Open\tCTRL+O" +msgstr "Ouvrir\tCTRL+O" + +#: targets/toolchain_gcc.py:95 +msgid "PLC :\n" +msgstr "Automate :\n" + +#: plugger.py:1447 +#: plugger.py:1483 +#: plugger.py:1723 +#, python-format +msgid "PLC is %s\n" +msgstr "L'automate est dans l'état %s\n" + +#: Beremiz.py:1390 +msgid "Please enter a name for plugin:" +msgstr "Saisissez un nom pour le plugin :" + +#: runtime/PLCObject.py:219 +msgid "Please stop PLC to close" +msgstr "Veuillez arrêter l'automate pour quitter" + +#: targets/toolchain_gcc.py:93 +msgid "Plugin : " +msgstr "Plugin :" + +#: plugger.py:1295 +msgid "Plugins code generation failed !\n" +msgstr "La création du code des plugins a échoué !\n" + +#: Beremiz_service.py:325 +msgid "Port number must be 0 <= port <= 65535!" +msgstr "Le numéro de port doit être compris entre 0 et 65535 !" + +#: Beremiz_service.py:325 +msgid "Port number must be an integer!" +msgstr "Le numéro de port doit être un entier !" + +#: runtime/PLCObject.py:279 +#, python-format +msgid "Problem %s PLC" +msgstr "Problème lors du %s de l'automate" + +#: plugger.py:789 +msgid "Project not created" +msgstr "Le projet n'a pu être créé" + +#: plugger.py:503 +#, python-format +msgid "Project tree layout do not match plugin.xml %s!=%s " +msgstr "L'organisation du projet ne correspond pas à plugin.xml %s!=%s" + +#: Beremiz.py:295 +msgid "Properties" +msgstr "Propriétés" + +#: Beremiz_service.py:433 +msgid "Publish service on local network" +msgstr "Le service est publié sur le réseau local" + +#: plugger.py:1851 +msgid "Python code" +msgstr "Code Python" + +#: runtime/PLCObject.py:282 +msgid "PythonThreadProc interrupted" +msgstr "PythonThreadProc a été interrompu" + +#: PythonSTC.py:577 +msgid "Question" +msgstr "Question" + +#: Beremiz_service.py:287 +msgid "Quit" +msgstr "Quitter" + +#: Beremiz.py:298 +msgid "Quit\tCTRL+Q" +msgstr "Quitter\tCTRL+Q" + +#: plugger.py:1847 +msgid "Raw IEC code" +msgstr "Ajout code IEC" + +#: Beremiz.py:1398 +msgid "Really delete plugin ?" +msgstr "Voulez-vous réellement supprimer le plugin ?" + +#: discovery.py:64 +msgid "Refresh" +msgstr "Actualiser" + +#: Beremiz.py:1398 +msgid "Remove plugin" +msgstr "Enlever le plugin" + +#: Beremiz.py:325 +#: plugger.py:1809 +msgid "Run" +msgstr "Exécuter" + +#: Beremiz.py:290 +msgid "Save\tCTRL+S" +msgstr "Enregistrer\tCTRL+S" + +#: Beremiz.py:328 +msgid "Save Log" +msgstr "Enregistrer le log" + +#: Beremiz.py:523 +#: Beremiz.py:1298 +msgid "Save changes ?" +msgstr "Enregistrer les changements ?" + +#: discovery.py:37 +msgid "Service Discovery" +msgstr "Découverte de service" + +#: plugger.py:1844 +msgid "Show IEC code generated by PLCGenerator" +msgstr "Afficher le code IEC généré par PLCGenerator" + +#: plugins/canfestival/canfestival.py:202 +msgid "Show Master" +msgstr "Afficher le maître" + +#: plugins/canfestival/canfestival.py:203 +msgid "Show Master generated by config_utils" +msgstr "Afficher le maître généré par config_utils" + +#: plugger.py:1842 +msgid "Show code" +msgstr "Afficher le code" + +#: Beremiz.py:323 +msgid "Simulate" +msgstr "Simuler" + +#: plugger.py:1811 +#: Beremiz_service.py:278 +#: runtime/PLCObject.py:285 +msgid "Start PLC" +msgstr "Démarrer l'automate" + +#: plugger.py:1816 +msgid "Start PLC (debug mode)" +msgstr "Démarrer l'automate (en mode debug)" + +#: plugger.py:1273 +#, python-format +msgid "Start build in %s\n" +msgstr "Début de la compilation dans %s\n" + +#: plugger.py:1452 +msgid "Started" +msgstr "Démarré" + +#: plugger.py:1631 +msgid "Starting PLC (debug mode)\n" +msgstr "Démarrage de l'automate (en mode debug) en cours\n" + +#: plugger.py:1823 +msgid "Stop" +msgstr "Arrêter" + +#: Beremiz_service.py:279 +#: runtime/PLCObject.py:291 +msgid "Stop PLC" +msgstr "Arrêter l'automate" + +#: plugger.py:1825 +msgid "Stop Running PLC" +msgstr "Arrêter l'automate en cours d'exécution" + +#: plugger.py:1455 +msgid "Stopped" +msgstr "Arrêté" + +#: plugger.py:1670 +msgid "Stopping debug\n" +msgstr "Arrêt du débogage en cours\n" + +#: Beremiz_service.py:426 +msgid "The daemon runs on port :" +msgstr "Le service est disponible sur le port :" + +#: Beremiz_service.py:427 +msgid "The object's uri is :" +msgstr "L' URI de l'objet est :" + +#: Beremiz_service.py:428 +msgid "The working directory :" +msgstr "Le répertoire de travail :" + +#: plugger.py:1832 +msgid "Transfer" +msgstr "Transférer" + +#: plugger.py:1834 +msgid "Transfer PLC" +msgstr "Transférer l'automate" + +#: plugger.py:1787 +msgid "Transfer completed successfully.\n" +msgstr "Transfert effectué avec succès.\n" + +#: plugger.py:1789 +msgid "Transfer failed\n" +msgstr "Le transfert a échoué\n" + +#: targets/Xenomai/__init__.py:27 +msgid "Unable to get Xenomai's CFLAGS\n" +msgstr "Impossible d'obtenir les CFLAGS de Xenomai\n" + +#: targets/Xenomai/__init__.py:16 +msgid "Unable to get Xenomai's LDFLAGS\n" +msgstr "Impossible d'obtenir les LDFLAGS de Xenomai\n" + +#: plugger.py:1855 +msgid "WXGLADE GUI" +msgstr "IHM WXGlade" + +#: plugger.py:936 +msgid "Warnings in ST/IL/SFC code generator :\n" +msgstr "Mises en garde du generateur de code ST/IL/SFC :\n" + +#: plugger.py:1852 +msgid "Write Python runtime code, for use with python_eval FBs" +msgstr "Ecrivez le code Python du runtime, à utiliser avec les blocs python_eval" + +#: connectors/PYRO/__init__.py:39 +msgid "Wrong URI, please check it !\n" +msgstr "URI inconnue, veuillez vérifier l'adresse !\n" + +#: PythonSTC.py:575 +msgid "You are about to overwrite that file\n" +msgstr "Vous allez écraser ce fichier\n" + +#: wxPopen.py:134 +#, python-format +msgid "exited with status %s (pid %s)\n" +msgstr "a quitté avec le status %s (pid %s)\n" + +#: Beremiz.py:1417 +#: Beremiz.py:1419 +msgid "file : " +msgstr "fichier :" + +#: Beremiz.py:1420 +msgid "function : " +msgstr "fonction :" + +#: Beremiz.py:1420 +msgid "line : " +msgstr "ligne :" + +#: runtime/PLCObject.py:277 +msgid "loading" +msgstr "chargement" + +#: runtime/PLCObject.py:275 +msgid "starting" +msgstr "démarrage" + +#: Extra XSD strings +msgid "BaseParams" +msgstr "Paramètres de base" + +msgid "Name" +msgstr "Nom" + +msgid "IEC_Channel" +msgstr "Numéro IEC" + +msgid "Enabled" +msgstr "Actif" + +msgid "BeremizRoot" +msgstr "Racine de Beremiz" + +msgid "TargetType" +msgstr "Type de cible" + +msgid "URI_location" +msgstr "Adresse URI" + +msgid "Enable_Plugins" +msgstr "Plugins actifs" + +msgid "CExtension" +msgstr "Extension C" + +msgid "CFLAGS" +msgstr "CFLAGS" + +msgid "LDFLAGS" +msgstr "LDFLAGS" + +msgid "CanFestivalSlaveNode" +msgstr "Noeud esclave CanFestival" + +msgid "CAN_Device" +msgstr "Port CAN" + +msgid "CAN_Baudrate" +msgstr "Vitesse CAN" + +msgid "NodeId" +msgstr "NodeId" + +msgid "Sync_Align" +msgstr "Aligner sur synchro" + +msgid "Sync_Align_Ratio" +msgstr "Rapport d'alignement" + +msgid "CanFestivalNode" +msgstr "Noeud CanFestival" + +msgid "Sync_TPDOs" +msgstr "TPDOs sur synchro" + +msgid "CanFestivalInstance" +msgstr "Instance CanFestival" + +msgid "CAN_Driver" +msgstr "Driver CAN" + +msgid "Debug_mode" +msgstr "Mode de débogage" + +msgid "Compiler" +msgstr "Compileur" + +msgid "Linker" +msgstr "Linkeur" + +msgid "Linux" +msgstr "Linux" + +msgid "Rtai" +msgstr "Rtai" + +msgid "rtai_config" +msgstr "Config Rtai" + +msgid "Win32" +msgstr "Win32" + +msgid "Xenomai" +msgstr "Xenomai" + +msgid "XenoConfig" +msgstr "Config Xenomai" + diff -r 32339ad7d9ae -r 331d698e1118 i18n/Beremiz_zh_CN.po --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/i18n/Beremiz_zh_CN.po Tue Jul 28 17:43:19 2009 +0200 @@ -0,0 +1,989 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-06-24 18:44+0200\n" +"PO-Revision-Date: 2009-07-02 18:27+0100\n" +"Last-Translator: \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: Beremiz.py:1429 +#, python-format +msgid "" +"\n" +"An unhandled exception (bug) occured. Bug report saved at :\n" +"(%s)\n" +"\n" +"Please contact LOLITech at:\n" +"+33 (0)3 29 57 60 42\n" +"or please be kind enough to send this file to:\n" +"bugs_beremiz@lolitech.fr\n" +"\n" +"You should now restart Beremiz.\n" +"\n" +"Traceback:\n" +msgstr "" +"\n" +"一个未处理的异常(漏洞)出现。漏洞报告存为:\n" +"(%s)\n" +"\n" +"请用以下方式联系LOLITech:\n" +"+33 (0)3 29 57 60 42\n" +"或者请将文件发送至下列邮箱:\n" +"bugs_beremiz@lolitech.fr\n" +"\n" +"你现在必须重新启动Beremiz。\n" +"\n" +"回溯:\n" + +#: plugger.py:1332 +msgid " generation failed !\n" +msgstr "生成失败!\n" + +#: Beremiz.py:1288 +#, python-format +msgid "\"%s\" folder is not a valid Beremiz project\n" +msgstr "\"%s\" 文件夹不是有效的Beremiz项目\n" + +#: Beremiz_service.py:467 +#: runtime/PLCObject.py:269 +msgid "#EXCEPTION : " +msgstr "#异常:" + +#: Beremiz.py:1417 +#: Beremiz.py:1419 +#: Beremiz.py:1420 +msgid ", " +msgstr "," + +#: Beremiz.py:1415 +msgid ". " +msgstr "。" + +#: plugger.py:395 +#, python-format +msgid "A child names \"%s\" already exist -> \"%s\"\n" +msgstr "分支名字 \"%s\" 已经存在 -> \"%s\"\n" + +#: plugger.py:427 +#, python-format +msgid "A child with IEC channel %d already exist -> %d\n" +msgstr "一个IEC通道的分支 %d 已经存在 -> %d\n" + +#: Beremiz.py:342 +msgid "About" +msgstr "关于" + +#: Beremiz.py:1357 +msgid "About Beremiz" +msgstr "关于Beremiz" + +#: Beremiz.py:311 +#: Beremiz.py:1390 +msgid "Add Plugin" +msgstr "添加插件" + +#: Beremiz.py:612 +#: Beremiz.py:874 +msgid "Add a sub plugin" +msgstr "添加一个子插件" + +#: plugger.py:1680 +msgid "Already connected. Please disconnect\n" +msgstr "已经连接。请断开连接\n" + +#: Beremiz.py:1056 +msgid "Append " +msgstr "追加" + +#: plugins/canfestival/config_utils.py:341 +#: plugins/canfestival/config_utils.py:623 +#, python-format +msgid "Bad location size : %s" +msgstr "不好的位置大小:%s" + +#: Beremiz.py:392 +msgid "Beremiz" +msgstr "Beremiz" + +#: Beremiz.py:340 +msgid "Beremiz\tF1" +msgstr "Beremiz\tF1" + +#: plugger.py:1464 +msgid "Broken" +msgstr "损坏" + +#: plugger.py:1800 +msgid "Build" +msgstr "构建" + +#: Beremiz.py:320 +msgid "Build\tCTRL+R" +msgstr "建立\tCTRL+R" + +#: plugger.py:1434 +msgid "Build directory already clean\n" +msgstr "构建目录已经清除\n" + +#: plugger.py:1801 +msgid "Build project into build folder" +msgstr "在构建文件夹中构建项目" + +#: plugger.py:1350 +msgid "C Build crashed !\n" +msgstr "C构建损坏!\n" + +#: plugger.py:1347 +msgid "C Build failed.\n" +msgstr "C构建失败。\n" + +#: plugger.py:1336 +msgid "C code generated successfully.\n" +msgstr "C代码生成成功。\n" + +#: targets/toolchain_gcc.py:119 +#, python-format +msgid "C compilation of %s failed.\n" +msgstr " %s 的C编译失败。\n" + +#: plugger.py:1037 +#, python-format +msgid "Can't find module for target %s!\n" +msgstr "无法为目标找到模型 %s!\n" + +#: discovery.py:79 +msgid "Cancel" +msgstr "取消" + +#: plugger.py:1746 +msgid "Cannot compare latest build to target. Please build.\n" +msgstr "无法与目标比较最新的建立。\n" + +#: plugger.py:465 +#, python-format +msgid "Cannot create child %s of type %s " +msgstr "无法新建分支 %s 类型 %s " + +#: plugger.py:420 +#, python-format +msgid "Cannot find lower free IEC channel than %d\n" +msgstr "无法找到比 %d 更低的自由的IEC通道\n" + +#: connectors/PYRO/__init__.py:61 +msgid "Cannot get PLC status - connection failed.\n" +msgstr "无法获取PLC的状态 - 连接失败。\n" + +#: plugger.py:1161 +msgid "Cannot open/parse VARIABLES.csv!\n" +msgstr "无法打开/解析 VARIABLES.csv!\n" + +#: plugins/canfestival/config_utils.py:371 +#, python-format +msgid "Cannot set bit offset for non bool '%s' variable (ID:%d,Idx:%x,sIdx:%x))" +msgstr "无法设定位抵消非布尔 '%s' variable (ID:%d,Idx:%x,sIdx:%x)) " + +#: Beremiz_service.py:281 +msgid "Change IP of interface to bind" +msgstr "更改界面的ip用以绑定" + +#: Beremiz_service.py:280 +msgid "Change Name" +msgstr "更改名字" + +#: Beremiz_service.py:284 +msgid "Change Port Number" +msgstr "更改端口号" + +#: Beremiz_service.py:286 +msgid "Change working directory" +msgstr "更改工作目录" + +#: Beremiz.py:1249 +#: Beremiz.py:1272 +msgid "Choose a project" +msgstr "选择一个项目" + +#: Beremiz_service.py:332 +msgid "Choose a working directory " +msgstr "选择一个工作目录" + +#: plugger.py:1804 +msgid "Clean" +msgstr "清除" + +#: plugger.py:1806 +msgid "Clean project build folder" +msgstr "清除项目构建目录" + +#: plugger.py:1431 +msgid "Cleaning the build directory\n" +msgstr "清除构建目录\n" + +#: Beremiz.py:524 +#: Beremiz.py:1299 +msgid "Close Application" +msgstr "关闭应用" + +#: Beremiz.py:292 +msgid "Close Project" +msgstr "关闭项目" + +#: plugger.py:963 +msgid "Compiling IEC Program in to C code...\n" +msgstr "正在将IEC程序编译成C代码...\n" + +#: plugins/canfestival/config_utils.py:335 +#: plugins/canfestival/config_utils.py:617 +#, python-format +msgid "Conflict type for location \"%s\"" +msgstr "位置的冲突类型 \"%s\"" + +#: plugger.py:1828 +msgid "Connect" +msgstr "连接" + +#: plugger.py:1829 +msgid "Connect to the target PLC" +msgstr "连接到PLC目标" + +#: connectors/PYRO/__init__.py:31 +#, python-format +msgid "Connecting to URI : %s\n" +msgstr "连接到URI: %s!\n" + +#: plugger.py:1713 +#, python-format +msgid "Connection failed to %s!\n" +msgstr "连接失败 %s!\n" + +#: plugger.py:581 +#, python-format +msgid "" +"Could not add child \"%s\", type %s :\n" +"%s\n" +msgstr "" +"无法添加分支 \"%s\", type %s :\n" +"%s\n" + +#: plugger.py:558 +#, python-format +msgid "" +"Couldn't load plugin base parameters %s :\n" +" %s" +msgstr "" +"无法下载插件基本参数 %s :\n" +" %s" + +#: plugger.py:569 +#, python-format +msgid "" +"Couldn't load plugin parameters %s :\n" +" %s" +msgstr "" +"无法下载插件参数 %s :\n" +" %s" + +#: plugger.py:1644 +msgid "Couldn't start PLC debug !\n" +msgstr "无法开始PLC调试!\n" + +#: plugger.py:1674 +msgid "Couldn't stop PLC !\n" +msgstr "无法停止PLC!\n" + +#: plugger.py:1814 +msgid "Debug" +msgstr "调试" + +#: plugger.py:1514 +#, python-format +msgid "Debug : Unknown variable %s\n" +msgstr "调试 :未知变量 %s\n" + +#: plugger.py:1622 +msgid "Debug Thread couldn't be killed" +msgstr "调试线程不能结束" + +#: plugger.py:1609 +#, python-format +msgid "Debug data not coherent %d != %d\n" +msgstr "调试不和谐的数据 %d != %d\n" + +#: runtime/PLCObject.py:424 +#, python-format +msgid "Debug error idx : %d, expected_idx %d, type : %s" +msgstr "调试错误 idx : %d, expected_idx %d, 类型 : %s" + +#: plugger.py:1614 +msgid "Debugger disabled\n" +msgstr "调试器禁用\n" + +#: Beremiz.py:313 +msgid "Delete Plugin" +msgstr "删除插件" + +#: Beremiz.py:865 +msgid "Delete this plugin" +msgstr "删除这个插件" + +#: plugger.py:1461 +msgid "Dirty" +msgstr "变质" + +#: plugger.py:1837 +msgid "Disconnect" +msgstr "断开" + +#: plugger.py:1839 +msgid "Disconnect from PLC" +msgstr "从PLC断开" + +#: plugger.py:1467 +msgid "Disconnected" +msgstr "已断开" + +#: PythonSTC.py:576 +msgid "Do you want to continue?" +msgstr "你希望继续吗?" + +#: Beremiz.py:1261 +msgid "ERROR" +msgstr "错误" + +#: plugins/c_ext/c_ext.py:204 +#: plugins/c_ext/c_ext.py:205 +msgid "Edit C File" +msgstr "编辑C文件" + +#: plugins/canfestival/canfestival.py:200 +msgid "Edit CanOpen Network with NetworkEdit" +msgstr "用网络编辑器编辑CanOpen网络" + +#: plugger.py:1796 +msgid "Edit PLC" +msgstr "编辑PLC" + +#: Beremiz.py:308 +msgid "Edit PLC\tCTRL+R" +msgstr "编辑PLC\tCTRL+R" + +#: plugger.py:1797 +msgid "Edit PLC program with PLCOpenEditor" +msgstr "使用PLCOpen编辑器编辑PLC程序" + +#: plugger.py:1856 +msgid "Edit a WxWidgets GUI with WXGlade" +msgstr "用 WXGlade 编辑一个 WxWidgets 用户图形界面" + +#: plugins/canfestival/canfestival.py:199 +msgid "Edit network" +msgstr "编辑网络" + +#: plugger.py:1848 +msgid "Edit raw IEC code added to code generated by PLCGenerator" +msgstr "编辑原始的IEC代码添加至PLCGenerator生成的代码" + +#: plugger.py:1458 +msgid "Empty" +msgstr "空的" + +#: Beremiz.py:815 +msgid "Enable/Disable this plugin" +msgstr "激活/禁用这个插件" + +#: Beremiz_service.py:339 +msgid "Enter a name " +msgstr "输入一个名字" + +#: Beremiz_service.py:324 +msgid "Enter a port number " +msgstr "输入一个端口号" + +#: Beremiz_service.py:314 +msgid "Enter the ip of the interface to bind" +msgstr "输入界面的ip用以绑定" + +#: Beremiz.py:1284 +#: Beremiz.py:1288 +#: Beremiz.py:1443 +#: Beremiz.py:1453 +#: Beremiz_service.py:229 +#: Beremiz_service.py:353 +msgid "Error" +msgstr "错误" + +#: plugger.py:1010 +msgid "Error : At least one configuration and one ressource must be declared in PLC !\n" +msgstr "错误:在PLC中,必须申明至少一个配置和一个资源!\n" + +#: plugger.py:1002 +#, python-format +msgid "Error : IEC to C compiler returned %d\n" +msgstr "错误:IEC到C编译器返回 %d\n" + +#: plugger.py:941 +#, python-format +msgid "" +"Error in ST/IL/SFC code generator :\n" +"%s\n" +msgstr "" +"错误在ST/IL/SFC代码生成器中:\n" +"%s\n" + +#: plugger.py:202 +#, python-format +msgid "Error while saving \"%s\"\n" +msgstr "存储时有错误 \"%s\"\n" + +#: plugins/canfestival/canfestival.py:191 +msgid "Error: No Master generated\n" +msgstr "错误:没有主控生成\n" + +#: plugins/canfestival/canfestival.py:186 +msgid "Error: No PLC built\n" +msgstr "错误:没有PLC构建\n" + +#: plugger.py:1707 +#, python-format +msgid "Exception while connecting %s!\n" +msgstr "连接时存在异常 %s!\n" + +#: plugger.py:1014 +msgid "Extracting Located Variables...\n" +msgstr "正在提取位置变量......\n" + +#: plugger.py:1761 +msgid "Failed : Must build before transfer.\n" +msgstr "失败:传输之前必须构建。\n" + +#: plugger.py:1341 +msgid "Fatal : cannot get builder.\n" +msgstr "致命错误:无法获取构建者。\n" + +#: Beremiz.py:347 +msgid "File" +msgstr "文件" + +#: plugger.py:815 +msgid "Folder choosen doesn't contain a program. It's not a valid project!" +msgstr "被选中的文件夹未包含一个程序。它不是一个有效项目!" + +#: plugger.py:780 +msgid "Folder choosen isn't empty. You can't use it for a new project!" +msgstr "被选中的文件夹非空。你不能用它创建一个新项目!" + +#: connectors/PYRO/__init__.py:93 +msgid "Force runtime reload\n" +msgstr "强制重新运行\n" + +#: plugger.py:931 +msgid "Generating SoftPLC IEC-61131 ST/IL/SFC code...\n" +msgstr "生成软PLC IEC-61131 ST/IL/SFC 代码......\n" + +#: plugger.py:1289 +msgid "Generating plugins C code\n" +msgstr "生成C代码插件\n" + +#: Beremiz.py:350 +msgid "Help" +msgstr "帮助" + +#: plugger.py:1281 +msgid "IEC-61131-3 code generation failed !\n" +msgstr "IEC-61131-3代码生成失败!\n" + +#: plugins/canfestival/config_utils.py:376 +#: plugins/canfestival/config_utils.py:637 +#, python-format +msgid "Invalid type \"%s\"-> %d != %d for location\"%s\"" +msgstr "无效类型 \"%s\"-> %d != %d 用于位置 \"%s\"" + +#: Beremiz_service.py:315 +#: Beremiz_service.py:316 +msgid "Ip is not valid!" +msgstr "Ip无效!" + +#: plugger.py:1767 +msgid "Latest build already match current target. Transfering anyway...\n" +msgstr "最新构建已经与当前目标匹配。正在传输中......\n" + +#: plugger.py:1737 +msgid "Latest build do not match with target, please transfer.\n" +msgstr "最新构建与目标不匹配,请传输。\n" + +#: plugger.py:1741 +msgid "Latest build match target, no transfer needed.\n" +msgstr "最新构建与目标匹配,不需要传输。\n" + +#: Beremiz_service.py:283 +msgid "Launch WX GUI inspector" +msgstr "启动 WX GUI 检查员" + +#: Beremiz_service.py:282 +msgid "Launch a live Python shell" +msgstr "启动一个活的Python Shell" + +#: targets/toolchain_gcc.py:127 +msgid "Linking :\n" +msgstr "链接:\n" + +#: discovery.py:72 +msgid "Local" +msgstr "本地" + +#: Beremiz.py:435 +msgid "Log Console" +msgstr "控制台日志" + +#: plugger.py:475 +#, python-format +msgid "Max count (%d) reached for this plugin of type %s " +msgstr "最大计数 (%d) 到达" + +#: runtime/ServicePublisher.py:50 +msgid "My IP is :" +msgstr "我的IP是:" + +#: Beremiz_service.py:340 +msgid "Name must not be null!" +msgstr "名称不能为空!" + +#: Beremiz.py:286 +msgid "New\tCTRL+N" +msgstr "新建\tCTRL+N" + +#: runtime/PLCObject.py:313 +#, python-format +msgid "NewPLC (%s)" +msgstr "新的PLC(%s)" + +#: plugger.py:1791 +msgid "No PLC to transfer (did build success ?)\n" +msgstr "没有PLC可传输(构建是否成功?)\n" + +#: Beremiz_service.py:353 +msgid "No runnning PLC" +msgstr "没有正在运行的PLC" + +#: plugins/canfestival/config_utils.py:632 +#, python-format +msgid "No such index/subindex (%x,%x) (variable %s)" +msgstr "没有这样的索引/子索引 (%x,%x) (variable %s)" + +#: plugins/canfestival/config_utils.py:361 +#, python-format +msgid "No such index/subindex (%x,%x) in ID : %d (variable %s)" +msgstr "没有这样的索引/子索引 (%x,%x) in ID : %d (variable %s)" + +#: plugins/canfestival/config_utils.py:354 +#, python-format +msgid "Non existing node ID : %d (variable %s)" +msgstr "不存在节点ID:%d (variable %s)" + +#: plugins/canfestival/config_utils.py:383 +#, python-format +msgid "Not PDO mappable variable : '%s' (ID:%d,Idx:%x,sIdx:%x))" +msgstr "不是PDO填图变量: '%s' (ID:%d,Idx:%x,sIdx:%x))" + +#: discovery.py:83 +msgid "OK" +msgstr "确定" + +#: Beremiz.py:288 +msgid "Open\tCTRL+O" +msgstr "打开\tCTRL+O" + +#: targets/toolchain_gcc.py:95 +msgid "PLC :\n" +msgstr "PLC:\n" + +#: plugger.py:1447 +#: plugger.py:1483 +#: plugger.py:1723 +#, python-format +msgid "PLC is %s\n" +msgstr "PLC 是 %s\n" + +#: Beremiz.py:1390 +msgid "Please enter a name for plugin:" +msgstr "请为插件输入一个名字:" + +#: runtime/PLCObject.py:219 +msgid "Please stop PLC to close" +msgstr "请停止PLC以便关闭" + +#: targets/toolchain_gcc.py:93 +msgid "Plugin : " +msgstr "插件:" + +#: plugger.py:1295 +msgid "Plugins code generation failed !\n" +msgstr "插件代码生成失败!\n" + +#: Beremiz_service.py:325 +msgid "Port number must be 0 <= port <= 65535!" +msgstr "端口号必须为 0 <= 端口号 <= 65535!" + +#: Beremiz_service.py:325 +msgid "Port number must be an integer!" +msgstr "端口号必须是整数!" + +#: runtime/PLCObject.py:279 +#, python-format +msgid "Problem %s PLC" +msgstr "问题 %s PLC" + +#: plugger.py:789 +msgid "Project not created" +msgstr "项目未创建" + +#: plugger.py:503 +#, python-format +msgid "Project tree layout do not match plugin.xml %s!=%s " +msgstr "项目树型布局与 plugin.xml 不匹配 %s!=%s " + +#: Beremiz.py:295 +msgid "Properties" +msgstr "属性" + +#: Beremiz_service.py:433 +msgid "Publish service on local network" +msgstr "在本地网络发布服务" + +#: plugger.py:1851 +msgid "Python code" +msgstr "Python代码" + +#: runtime/PLCObject.py:282 +msgid "PythonThreadProc interrupted" +msgstr "Python线程处理被中断" + +#: PythonSTC.py:577 +msgid "Question" +msgstr "问题" + +#: Beremiz_service.py:287 +msgid "Quit" +msgstr "退出" + +#: Beremiz.py:298 +msgid "Quit\tCTRL+Q" +msgstr "退出\tCTRL+Q" + +#: plugger.py:1847 +msgid "Raw IEC code" +msgstr "原始的IEC代码" + +#: Beremiz.py:1398 +msgid "Really delete plugin ?" +msgstr "确定删除插件?" + +#: discovery.py:64 +msgid "Refresh" +msgstr "刷新" + +#: Beremiz.py:1398 +msgid "Remove plugin" +msgstr "移除这个插件" + +#: Beremiz.py:325 +#: plugger.py:1809 +msgid "Run" +msgstr "运行" + +#: Beremiz.py:290 +msgid "Save\tCTRL+S" +msgstr "保存\tCTRL+S" + +#: Beremiz.py:328 +msgid "Save Log" +msgstr "保存日志" + +#: Beremiz.py:523 +#: Beremiz.py:1298 +msgid "Save changes ?" +msgstr "保存修改?" + +#: discovery.py:37 +msgid "Service Discovery" +msgstr "服务探索" + +#: plugger.py:1844 +msgid "Show IEC code generated by PLCGenerator" +msgstr "显示由PLCGenerator生成的IEC代码" + +#: plugins/canfestival/canfestival.py:202 +msgid "Show Master" +msgstr "显示主控" + +#: plugins/canfestival/canfestival.py:203 +msgid "Show Master generated by config_utils" +msgstr "显示由config_utils生成的主控" + +#: plugger.py:1842 +msgid "Show code" +msgstr "显示代码" + +#: Beremiz.py:323 +msgid "Simulate" +msgstr "模拟" + +#: plugger.py:1811 +#: Beremiz_service.py:278 +#: runtime/PLCObject.py:285 +msgid "Start PLC" +msgstr "开始PLC" + +#: plugger.py:1816 +msgid "Start PLC (debug mode)" +msgstr "开始PLC(调试模式)" + +#: plugger.py:1273 +#, python-format +msgid "Start build in %s\n" +msgstr "开始建立 %s\n" + +#: plugger.py:1452 +msgid "Started" +msgstr "已开始" + +#: plugger.py:1631 +msgid "Starting PLC (debug mode)\n" +msgstr "正在开始PLC(调试模式)\n" + +#: plugger.py:1823 +msgid "Stop" +msgstr "停止" + +#: Beremiz_service.py:279 +#: runtime/PLCObject.py:291 +msgid "Stop PLC" +msgstr "停止PLC" + +#: plugger.py:1825 +msgid "Stop Running PLC" +msgstr "停止运行PLC" + +#: plugger.py:1455 +msgid "Stopped" +msgstr "已停止" + +#: plugger.py:1670 +msgid "Stopping debug\n" +msgstr "正在停止调试\n" + +#: Beremiz_service.py:426 +msgid "The daemon runs on port :" +msgstr "守护进程在端口运行:" + +#: Beremiz_service.py:427 +msgid "The object's uri is :" +msgstr "对象的uri是:" + +#: Beremiz_service.py:428 +msgid "The working directory :" +msgstr "工作目录:" + +#: plugger.py:1832 +msgid "Transfer" +msgstr "传输" + +#: plugger.py:1834 +msgid "Transfer PLC" +msgstr "传输PLC" + +#: plugger.py:1787 +msgid "Transfer completed successfully.\n" +msgstr "传输成功\n" + +#: plugger.py:1789 +msgid "Transfer failed\n" +msgstr "传输失败\n" + +#: targets/Xenomai/__init__.py:27 +msgid "Unable to get Xenomai's CFLAGS\n" +msgstr "无法获取Xenomai的CFLAGS\n" + +#: targets/Xenomai/__init__.py:16 +msgid "Unable to get Xenomai's LDFLAGS\n" +msgstr "无法获取Xenomai的LDFLAGS\n" + +#: plugger.py:1855 +msgid "WXGLADE GUI" +msgstr "WXGLADE 用户图形界面" + +#: plugger.py:936 +msgid "Warnings in ST/IL/SFC code generator :\n" +msgstr "警告在ST/IL/SFC代码生成器中:\n" + +#: plugger.py:1852 +msgid "Write Python runtime code, for use with python_eval FBs" +msgstr "编辑Python运行时间代码,与python_eval FBs一起使用" + +#: connectors/PYRO/__init__.py:39 +msgid "Wrong URI, please check it !\n" +msgstr "错误的URI,请检查!\n" + +#: PythonSTC.py:575 +msgid "You are about to overwrite that file\n" +msgstr "你即将要覆盖该文件\n" + +#: wxPopen.py:134 +#, python-format +msgid "exited with status %s (pid %s)\n" +msgstr "退出并保持现状 %s (pid %s)\n" + +#: Beremiz.py:1417 +#: Beremiz.py:1419 +msgid "file : " +msgstr "文件:" + +#: Beremiz.py:1420 +msgid "function : " +msgstr "功能:" + +#: Beremiz.py:1420 +msgid "line : " +msgstr "在线:" + +#: runtime/PLCObject.py:277 +msgid "loading" +msgstr "载入" + +#: runtime/PLCObject.py:275 +msgid "starting" +msgstr "正在开始" + +#: Extra XSD strings +msgid "BaseParams" +msgstr "基本参照 " + +msgid "Name" +msgstr "名字" + +msgid "IEC_Channel" +msgstr "IEC_频道" + +msgid "Enabled" +msgstr "启用" + +msgid "BeremizRoot" +msgstr "Beremiz根" + +msgid "TargetType" +msgstr "目标类型" + +msgid "URI_location" +msgstr "URI_位置" + +msgid "Enable_Plugins" +msgstr "启用_插件" + +msgid "CExtension" +msgstr "C扩展" + +msgid "CFLAGS" +msgstr "CFLAGS" + +msgid "LDFLAGS" +msgstr "LDFLAGS" + +msgid "CanFestivalSlaveNode" +msgstr "CanFestival从节点" + +msgid "CAN_Device" +msgstr "CAN_设备" + +msgid "CAN_Baudrate" +msgstr "CAN_波特率" + +msgid "NodeId" +msgstr "节点Id" + +msgid "Sync_Align" +msgstr "同步_对齐" + +msgid "Sync_Align_Ratio" +msgstr "同步_对齐_比率" + +msgid "CanFestivalNode" +msgstr "CanFestival节点" + +msgid "Sync_TPDOs" +msgstr "Sync_TPDOs" + +msgid "CanFestivalInstance" +msgstr "CanFestival实例" + +msgid "CAN_Driver" +msgstr "CAN_驱动" + +msgid "Debug_mode" +msgstr "调试_模式" + +msgid "Compiler" +msgstr "编译" + +msgid "Linker" +msgstr "链接 " + +msgid "Linux" +msgstr "Linux" + +msgid "Rtai" +msgstr "Rtai" + +msgid "rtai_config" +msgstr "rtai_config" + +msgid "Win32" +msgstr "Win32" + +msgid "Xenomai" +msgstr "Xenomai" + +msgid "XenoConfig" +msgstr "XenoConfig" + +#~ msgid "#define %s beremiz%s\n" +#~ msgstr "#定义 %s beremiz%s\n" +#~ msgid "/* Beremiz c_ext plugin user variables definition */\n" +#~ msgstr "/* Beremiz c_ext 插件的用户变量定义 */\n" +#~ msgid "/* Beremiz plugin functions */\n" +#~ msgstr "/* Beremiz插件功能 */\n" +#~ msgid "" +#~ "/* Code generated by Beremiz c_ext plugin */\n" +#~ "\n" +#~ msgstr "" +#~ "/* 代码由Beremiz c_ext插件生成 */\n" +#~ "\n" +#~ msgid "/* User includes */\n" +#~ msgstr "/* 用户包含 */\n" +#~ msgid "/* User internal user variables and routines */\n" +#~ msgstr "/* 用户内部用户变量和例程 */\n" +#~ msgid "/* User variables reference */\n" +#~ msgstr "/* 用户变量参照 */\n" +#~ msgid "Choose a SVG file" +#~ msgstr "选择一个SVG文件" +#~ msgid "Choose a XML file" +#~ msgstr "选择一个XML文件" +#~ msgid "Couldn't start PLC !\n" +#~ msgstr "无法开始PLC!\n" +#~ msgid "No corresponding output variable found on SVGUI Block \"%s\"" +#~ msgstr "没有相应的输出变量" +#~ msgid "No such SVG file: %s\n" +#~ msgstr "没有这样的SVG文件:%s\n" +#~ msgid "No such XML file: %s\n" +#~ msgstr "没有这样的XML文件:%s\n" +#~ msgid "Shortcuts created." +#~ msgstr "快捷方式已被建立。" + diff -r 32339ad7d9ae -r 331d698e1118 i18n/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/i18n/README Tue Jul 28 17:43:19 2009 +0200 @@ -0,0 +1,8 @@ +To generate message.pot file: + + python mki18n.py -p --domain=Beremiz + +To generate .mo files for all languages: + + python mki18n.py -m --moTarget=../locale --domain=Beremiz + \ No newline at end of file diff -r 32339ad7d9ae -r 331d698e1118 i18n/app.fil --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/i18n/app.fil Tue Jul 28 17:43:19 2009 +0200 @@ -0,0 +1,21 @@ +../Beremiz.py +../plugger.py +../beremiz_postinst.py +../Beremiz_service.py +../discovery.py +../PythonSTC.py +../wxPopen.py +../connectors/PYRO/__init__.py +../plugins/c_ext/c_ext.py +../plugins/canfestival/canfestival.py +../plugins/canfestival/config_utils.py +../plugins/svgui/svgui.py +../runtime/PLCObject.py +../runtime/ServicePublisher.py +../targets/toolchain_gcc.py +../targets/XSD_toolchain_gcc +../targets/Linux/XSD +../targets/Rtai/XSD +../targets/Win32/XSD +../targets/Xenomai/__init__.py +../targets/Xenomai/XSD \ No newline at end of file diff -r 32339ad7d9ae -r 331d698e1118 i18n/messages.pot --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/i18n/messages.pot Tue Jul 28 17:43:19 2009 +0200 @@ -0,0 +1,843 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-07-27 18:06+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../Beremiz.py:1429 +#, python-format +msgid "" +"\n" +"An unhandled exception (bug) occured. Bug report saved at :\n" +"(%s)\n" +"\n" +"Please contact LOLITech at:\n" +"+33 (0)3 29 57 60 42\n" +"or please be kind enough to send this file to:\n" +"bugs_beremiz@lolitech.fr\n" +"\n" +"You should now restart Beremiz.\n" +"\n" +"Traceback:\n" +msgstr "" + +#: ../plugger.py:1332 +msgid " generation failed !\n" +msgstr "" + +#: ../Beremiz.py:1288 +#, python-format +msgid "\"%s\" folder is not a valid Beremiz project\n" +msgstr "" + +#: ../Beremiz.py:1417 ../Beremiz.py:1419 ../Beremiz.py:1420 +msgid ", " +msgstr "" + +#: ../Beremiz.py:1415 +msgid ". " +msgstr "" + +#: ../plugger.py:395 +#, python-format +msgid "A child names \"%s\" already exist -> \"%s\"\n" +msgstr "" + +#: ../plugger.py:427 +#, python-format +msgid "A child with IEC channel %d already exist -> %d\n" +msgstr "" + +#: ../Beremiz.py:342 +msgid "About" +msgstr "" + +#: ../Beremiz.py:1357 +msgid "About Beremiz" +msgstr "" + +#: ../Beremiz.py:311 ../Beremiz.py:1390 +msgid "Add Plugin" +msgstr "" + +#: ../Beremiz.py:612 ../Beremiz.py:874 +msgid "Add a sub plugin" +msgstr "" + +#: ../plugger.py:1683 +msgid "Already connected. Please disconnect\n" +msgstr "" + +#: ../Beremiz.py:1056 +msgid "Append " +msgstr "" + +#: ../plugins/canfestival/config_utils.py:341 +#: ../plugins/canfestival/config_utils.py:623 +#, python-format +msgid "Bad location size : %s" +msgstr "" + +#: ../Beremiz.py:392 +msgid "Beremiz" +msgstr "" + +#: ../Beremiz.py:340 +msgid "Beremiz\tF1" +msgstr "" + +#: ../plugger.py:1463 +msgid "Broken" +msgstr "" + +#: ../plugger.py:1807 +msgid "Build" +msgstr "" + +#: ../Beremiz.py:320 +msgid "Build\tCTRL+R" +msgstr "" + +#: ../plugger.py:1434 +msgid "Build directory already clean\n" +msgstr "" + +#: ../plugger.py:1808 +msgid "Build project into build folder" +msgstr "" + +#: ../plugger.py:1350 +msgid "C Build crashed !\n" +msgstr "" + +#: ../plugger.py:1347 +msgid "C Build failed.\n" +msgstr "" + +#: ../plugger.py:1336 +msgid "C code generated successfully.\n" +msgstr "" + +#: ../targets/toolchain_gcc.py:119 +#, python-format +msgid "C compilation of %s failed.\n" +msgstr "" + +#: ../plugger.py:1037 +#, python-format +msgid "Can't find module for target %s!\n" +msgstr "" + +#: ../discovery.py:79 +msgid "Cancel" +msgstr "" + +#: ../plugger.py:1753 +msgid "Cannot compare latest build to target. Please build.\n" +msgstr "" + +#: ../plugger.py:465 +#, python-format +msgid "Cannot create child %s of type %s " +msgstr "" + +#: ../plugger.py:420 +#, python-format +msgid "Cannot find lower free IEC channel than %d\n" +msgstr "" + +#: ../connectors/PYRO/__init__.py:61 +msgid "Cannot get PLC status - connection failed.\n" +msgstr "" + +#: ../plugger.py:1161 +msgid "Cannot open/parse VARIABLES.csv!\n" +msgstr "" + +#: ../plugins/canfestival/config_utils.py:371 +#, python-format +msgid "Cannot set bit offset for non bool '%s' variable (ID:%d,Idx:%x,sIdx:%x))" +msgstr "" + +#: ../Beremiz_service.py:315 +msgid "Change IP of interface to bind" +msgstr "" + +#: ../Beremiz_service.py:314 +msgid "Change Name" +msgstr "" + +#: ../Beremiz_service.py:318 +msgid "Change Port Number" +msgstr "" + +#: ../Beremiz_service.py:320 +msgid "Change working directory" +msgstr "" + +#: ../Beremiz.py:1249 ../Beremiz.py:1272 +msgid "Choose a project" +msgstr "" + +#: ../Beremiz_service.py:366 +msgid "Choose a working directory " +msgstr "" + +#: ../plugger.py:1811 +msgid "Clean" +msgstr "" + +#: ../plugger.py:1813 +msgid "Clean project build folder" +msgstr "" + +#: ../plugger.py:1431 +msgid "Cleaning the build directory\n" +msgstr "" + +#: ../Beremiz.py:524 ../Beremiz.py:1299 +msgid "Close Application" +msgstr "" + +#: ../Beremiz.py:292 +msgid "Close Project" +msgstr "" + +#: ../plugger.py:963 +msgid "Compiling IEC Program in to C code...\n" +msgstr "" + +#: ../plugins/canfestival/config_utils.py:335 +#: ../plugins/canfestival/config_utils.py:617 +#, python-format +msgid "Conflict type for location \"%s\"" +msgstr "" + +#: ../plugger.py:1835 +msgid "Connect" +msgstr "" + +#: ../plugger.py:1836 +msgid "Connect to the target PLC" +msgstr "" + +#: ../connectors/PYRO/__init__.py:31 +#, python-format +msgid "Connecting to URI : %s\n" +msgstr "" + +#: ../plugger.py:1716 +#, python-format +msgid "Connection failed to %s!\n" +msgstr "" + +#: ../plugger.py:581 +#, python-format +msgid "" +"Could not add child \"%s\", type %s :\n" +"%s\n" +msgstr "" + +#: ../plugger.py:558 +#, python-format +msgid "" +"Couldn't load plugin base parameters %s :\n" +" %s" +msgstr "" + +#: ../plugger.py:569 +#, python-format +msgid "" +"Couldn't load plugin parameters %s :\n" +" %s" +msgstr "" + +#: ../plugger.py:1647 +msgid "Couldn't start PLC debug !\n" +msgstr "" + +#: ../plugger.py:1677 +msgid "Couldn't stop PLC !\n" +msgstr "" + +#: ../plugger.py:1821 +msgid "Debug" +msgstr "" + +#: ../plugger.py:1517 +#, python-format +msgid "Debug : Unknown variable %s\n" +msgstr "" + +#: ../plugger.py:1625 +msgid "Debug Thread couldn't be killed" +msgstr "" + +#: ../plugger.py:1612 +#, python-format +msgid "Debug data not coherent %d != %d\n" +msgstr "" + +#: ../plugger.py:1617 +msgid "Debugger disabled\n" +msgstr "" + +#: ../Beremiz.py:313 +msgid "Delete Plugin" +msgstr "" + +#: ../Beremiz.py:865 +msgid "Delete this plugin" +msgstr "" + +#: ../plugger.py:1460 +msgid "Dirty" +msgstr "" + +#: ../plugger.py:1844 +msgid "Disconnect" +msgstr "" + +#: ../plugger.py:1846 +msgid "Disconnect from PLC" +msgstr "" + +#: ../plugger.py:1466 +msgid "Disconnected" +msgstr "" + +#: ../Beremiz.py:1261 +msgid "ERROR" +msgstr "" + +#: ../plugins/c_ext/c_ext.py:204 ../plugins/c_ext/c_ext.py:205 +msgid "Edit C File" +msgstr "" + +#: ../plugins/canfestival/canfestival.py:200 +msgid "Edit CanOpen Network with NetworkEdit" +msgstr "" + +#: ../plugger.py:1803 +msgid "Edit PLC" +msgstr "" + +#: ../Beremiz.py:308 +msgid "Edit PLC\tCTRL+R" +msgstr "" + +#: ../plugger.py:1804 +msgid "Edit PLC program with PLCOpenEditor" +msgstr "" + +#: ../plugins/canfestival/canfestival.py:199 +msgid "Edit network" +msgstr "" + +#: ../plugger.py:1855 +msgid "Edit raw IEC code added to code generated by PLCGenerator" +msgstr "" + +#: ../plugger.py:1457 +msgid "Empty" +msgstr "" + +#: ../Beremiz.py:815 +msgid "Enable/Disable this plugin" +msgstr "" + +#: ../Beremiz_service.py:373 +msgid "Enter a name " +msgstr "" + +#: ../Beremiz_service.py:358 +msgid "Enter a port number " +msgstr "" + +#: ../Beremiz_service.py:348 +msgid "Enter the ip of the interface to bind" +msgstr "" + +#: ../Beremiz.py:1284 ../Beremiz.py:1288 ../Beremiz.py:1443 ../Beremiz.py:1453 +#: ../Beremiz_service.py:263 ../Beremiz_service.py:387 +msgid "Error" +msgstr "" + +#: ../plugger.py:1010 +msgid "Error : At least one configuration and one ressource must be declared in PLC !\n" +msgstr "" + +#: ../plugger.py:1002 +#, python-format +msgid "Error : IEC to C compiler returned %d\n" +msgstr "" + +#: ../plugger.py:941 +#, python-format +msgid "" +"Error in ST/IL/SFC code generator :\n" +"%s\n" +msgstr "" + +#: ../plugger.py:202 +#, python-format +msgid "Error while saving \"%s\"\n" +msgstr "" + +#: ../plugins/canfestival/canfestival.py:191 +msgid "Error: No Master generated\n" +msgstr "" + +#: ../plugins/canfestival/canfestival.py:186 +msgid "Error: No PLC built\n" +msgstr "" + +#: ../plugger.py:1710 +#, python-format +msgid "Exception while connecting %s!\n" +msgstr "" + +#: ../plugger.py:1014 +msgid "Extracting Located Variables...\n" +msgstr "" + +#: ../plugger.py:1768 +msgid "Failed : Must build before transfer.\n" +msgstr "" + +#: ../plugger.py:1341 +msgid "Fatal : cannot get builder.\n" +msgstr "" + +#: ../Beremiz.py:347 +msgid "File" +msgstr "" + +#: ../plugger.py:815 +msgid "Folder choosen doesn't contain a program. It's not a valid project!" +msgstr "" + +#: ../plugger.py:780 +msgid "Folder choosen isn't empty. You can't use it for a new project!" +msgstr "" + +#: ../connectors/PYRO/__init__.py:93 +msgid "Force runtime reload\n" +msgstr "" + +#: ../plugger.py:931 +msgid "Generating SoftPLC IEC-61131 ST/IL/SFC code...\n" +msgstr "" + +#: ../plugger.py:1289 +msgid "Generating plugins C code\n" +msgstr "" + +#: ../Beremiz.py:350 +msgid "Help" +msgstr "" + +#: ../plugger.py:1281 +msgid "IEC-61131-3 code generation failed !\n" +msgstr "" + +#: ../plugins/canfestival/config_utils.py:455 +#: ../plugins/canfestival/config_utils.py:469 +#, python-format +msgid "Impossible to define PDO mapping for node %02x" +msgstr "" + +#: ../plugins/canfestival/config_utils.py:376 +#: ../plugins/canfestival/config_utils.py:637 +#, python-format +msgid "Invalid type \"%s\"-> %d != %d for location\"%s\"" +msgstr "" + +#: ../Beremiz_service.py:349 ../Beremiz_service.py:350 +msgid "Ip is not valid!" +msgstr "" + +#: ../plugger.py:1774 +msgid "Latest build already match current target. Transfering anyway...\n" +msgstr "" + +#: ../plugger.py:1744 +msgid "Latest build do not match with target, please transfer.\n" +msgstr "" + +#: ../plugger.py:1748 +msgid "Latest build match target, no transfer needed.\n" +msgstr "" + +#: ../Beremiz_service.py:317 +msgid "Launch WX GUI inspector" +msgstr "" + +#: ../Beremiz_service.py:316 +msgid "Launch a live Python shell" +msgstr "" + +#: ../targets/toolchain_gcc.py:127 +msgid "Linking :\n" +msgstr "" + +#: ../discovery.py:72 +msgid "Local" +msgstr "" + +#: ../Beremiz.py:435 +msgid "Log Console" +msgstr "" + +#: ../plugger.py:475 +#, python-format +msgid "Max count (%d) reached for this plugin of type %s " +msgstr "" + +#: ../Beremiz_service.py:374 +msgid "Name must not be null!" +msgstr "" + +#: ../Beremiz.py:286 +msgid "New\tCTRL+N" +msgstr "" + +#: ../plugger.py:1798 +msgid "No PLC to transfer (did build success ?)\n" +msgstr "" + +#: ../Beremiz_service.py:387 +msgid "No runnning PLC" +msgstr "" + +#: ../plugins/canfestival/config_utils.py:632 +#, python-format +msgid "No such index/subindex (%x,%x) (variable %s)" +msgstr "" + +#: ../plugins/canfestival/config_utils.py:361 +#, python-format +msgid "No such index/subindex (%x,%x) in ID : %d (variable %s)" +msgstr "" + +#: ../plugins/canfestival/config_utils.py:354 +#, python-format +msgid "Non existing node ID : %d (variable %s)" +msgstr "" + +#: ../plugins/canfestival/config_utils.py:383 +#, python-format +msgid "Not PDO mappable variable : '%s' (ID:%d,Idx:%x,sIdx:%x))" +msgstr "" + +#: ../discovery.py:83 +msgid "OK" +msgstr "" + +#: ../Beremiz.py:288 +msgid "Open\tCTRL+O" +msgstr "" + +#: ../targets/toolchain_gcc.py:95 +msgid "PLC :\n" +msgstr "" + +#: ../plugger.py:1486 ../plugger.py:1730 +#, python-format +msgid "PLC is %s\n" +msgstr "" + +#: ../Beremiz.py:1390 +msgid "Please enter a name for plugin:" +msgstr "" + +#: ../runtime/PLCObject.py:219 +msgid "Please stop PLC to close" +msgstr "" + +#: ../targets/toolchain_gcc.py:93 +msgid "Plugin : " +msgstr "" + +#: ../plugger.py:1295 +msgid "Plugins code generation failed !\n" +msgstr "" + +#: ../Beremiz_service.py:359 +msgid "Port number must be 0 <= port <= 65535!" +msgstr "" + +#: ../Beremiz_service.py:359 +msgid "Port number must be an integer!" +msgstr "" + +#: ../plugger.py:789 +msgid "Project not created" +msgstr "" + +#: ../plugger.py:503 +#, python-format +msgid "Project tree layout do not match plugin.xml %s!=%s " +msgstr "" + +#: ../Beremiz.py:295 +msgid "Properties" +msgstr "" + +#: ../Beremiz_service.py:321 +msgid "Quit" +msgstr "" + +#: ../Beremiz.py:298 +msgid "Quit\tCTRL+Q" +msgstr "" + +#: ../plugger.py:1854 +msgid "Raw IEC code" +msgstr "" + +#: ../Beremiz.py:1398 +msgid "Really delete plugin ?" +msgstr "" + +#: ../discovery.py:64 +msgid "Refresh" +msgstr "" + +#: ../Beremiz.py:1398 +msgid "Remove plugin" +msgstr "" + +#: ../Beremiz.py:325 ../plugger.py:1816 +msgid "Run" +msgstr "" + +#: ../Beremiz.py:290 +msgid "Save\tCTRL+S" +msgstr "" + +#: ../Beremiz.py:328 +msgid "Save Log" +msgstr "" + +#: ../Beremiz.py:523 ../Beremiz.py:1298 +msgid "Save changes ?" +msgstr "" + +#: ../discovery.py:37 +msgid "Service Discovery" +msgstr "" + +#: ../plugger.py:1851 +msgid "Show IEC code generated by PLCGenerator" +msgstr "" + +#: ../plugins/canfestival/canfestival.py:202 +msgid "Show Master" +msgstr "" + +#: ../plugins/canfestival/canfestival.py:203 +msgid "Show Master generated by config_utils" +msgstr "" + +#: ../plugger.py:1849 +msgid "Show code" +msgstr "" + +#: ../Beremiz.py:323 +msgid "Simulate" +msgstr "" + +#: ../plugger.py:1818 ../Beremiz_service.py:312 +msgid "Start PLC" +msgstr "" + +#: ../plugger.py:1823 +msgid "Start PLC (debug mode)" +msgstr "" + +#: ../plugger.py:1273 +#, python-format +msgid "Start build in %s\n" +msgstr "" + +#: ../plugger.py:1451 +msgid "Started" +msgstr "" + +#: ../plugger.py:1634 +msgid "Starting PLC (debug mode)\n" +msgstr "" + +#: ../plugger.py:1830 +msgid "Stop" +msgstr "" + +#: ../Beremiz_service.py:313 +msgid "Stop PLC" +msgstr "" + +#: ../plugger.py:1832 +msgid "Stop Running PLC" +msgstr "" + +#: ../plugger.py:1454 +msgid "Stopped" +msgstr "" + +#: ../plugger.py:1673 +msgid "Stopping debug\n" +msgstr "" + +#: ../plugger.py:1839 +msgid "Transfer" +msgstr "" + +#: ../plugger.py:1841 +msgid "Transfer PLC" +msgstr "" + +#: ../plugger.py:1794 +msgid "Transfer completed successfully.\n" +msgstr "" + +#: ../plugger.py:1796 +msgid "Transfer failed\n" +msgstr "" + +#: ../targets/Xenomai/__init__.py:27 +msgid "Unable to get Xenomai's CFLAGS\n" +msgstr "" + +#: ../targets/Xenomai/__init__.py:16 +msgid "Unable to get Xenomai's LDFLAGS\n" +msgstr "" + +#: ../plugger.py:936 +msgid "Warnings in ST/IL/SFC code generator :\n" +msgstr "" + +#: ../connectors/PYRO/__init__.py:39 +msgid "Wrong URI, please check it !\n" +msgstr "" + +#: ../wxPopen.py:134 +#, python-format +msgid "exited with status %s (pid %s)\n" +msgstr "" + +#: ../Beremiz.py:1417 ../Beremiz.py:1419 +msgid "file : " +msgstr "" + +#: ../Beremiz.py:1420 +msgid "function : " +msgstr "" + +#: ../Beremiz.py:1420 +msgid "line : " +msgstr "" + +#: Extra XSD strings + +msgid "BaseParams" +msgstr "" + +msgid "Name" +msgstr "" + +msgid "IEC_Channel" +msgstr "" + +msgid "Enabled" +msgstr "" + +msgid "BeremizRoot" +msgstr "" + +msgid "TargetType" +msgstr "" + +msgid "URI_location" +msgstr "" + +msgid "Enable_Plugins" +msgstr "" + +msgid "CExtension" +msgstr "" + +msgid "CFLAGS" +msgstr "" + +msgid "LDFLAGS" +msgstr "" + +msgid "CanFestivalSlaveNode" +msgstr "" + +msgid "CAN_Device" +msgstr "" + +msgid "CAN_Baudrate" +msgstr "" + +msgid "NodeId" +msgstr "" + +msgid "Sync_Align" +msgstr "" + +msgid "Sync_Align_Ratio" +msgstr "" + +msgid "CanFestivalNode" +msgstr "" + +msgid "Sync_TPDOs" +msgstr "" + +msgid "CanFestivalInstance" +msgstr "" + +msgid "CAN_Driver" +msgstr "" + +msgid "Debug_mode" +msgstr "" + +msgid "Compiler" +msgstr "" + +msgid "Linker" +msgstr "" + +msgid "Linux" +msgstr "" + +msgid "Rtai" +msgstr "" + +msgid "rtai_config" +msgstr "" + +msgid "Win32" +msgstr "" + +msgid "Xenomai" +msgstr "" + +msgid "XenoConfig" +msgstr "" diff -r 32339ad7d9ae -r 331d698e1118 i18n/mki18n.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/i18n/mki18n.py Tue Jul 28 17:43:19 2009 +0200 @@ -0,0 +1,479 @@ +#! /usr/bin/env python +# -*- coding: iso-8859-1 -*- +# +# PYTHON MODULE: MKI18N.PY +# ========= +# +# Abstract: Make Internationalization (i18n) files for an application. +# +# Copyright Pierre Rouleau. 2003. Released to public domain. +# +# Last update: Saturday, November 8, 2003. @ 15:55:18. +# +# File: ROUP2003N01::C:/dev/python/mki18n.py +# +# RCS $Header: //software/official/MKS/MKS_SI/TV_NT/dev/Python/rcs/mki18n.py 1.5 2003/11/05 19:40:04 PRouleau Exp $ +# +# Update history: +# +# - File created: Saturday, June 7, 2003. by Pierre Rouleau +# - 10/06/03 rcs : RCS Revision 1.1 2003/06/10 10:06:12 PRouleau +# - 10/06/03 rcs : RCS Initial revision +# - 23/08/03 rcs : RCS Revision 1.2 2003/06/10 10:54:27 PRouleau +# - 23/08/03 P.R.: [code:fix] : The strings encoded in this file are encode in iso-8859-1 format. Added the encoding +# notification to Python to comply with Python's 2.3 PEP 263. +# - 23/08/03 P.R.: [feature:new] : Added the '-e' switch which is used to force the creation of the empty English .mo file. +# - 22/10/03 P.R.: [code] : incorporated utility functions in here to make script self sufficient. +# - 05/11/03 rcs : RCS Revision 1.4 2003/10/22 06:39:31 PRouleau +# - 05/11/03 P.R.: [code:fix] : included the unixpath() in this file. +# - 08/11/03 rcs : RCS Revision 1.5 2003/11/05 19:40:04 PRouleau +# +# RCS $Log: $ +# +# +# ----------------------------------------------------------------------------- +""" +mki18n allows you to internationalize your software. You can use it to +create the GNU .po files (Portable Object) and the compiled .mo files +(Machine Object). + +mki18n module can be used from the command line or from within a script (see +the Usage at the end of this page). + + Table of Contents + ----------------- + + makePO() -- Build the Portable Object file for the application -- + catPO() -- Concatenate one or several PO files with the application domain files. -- + makeMO() -- Compile the Portable Object files into the Machine Object stored in the right location. -- + printUsage -- Displays how to use this script from the command line -- + + Scriptexecution -- Runs when invoked from the command line -- + + +NOTE: this module uses GNU gettext utilities. + +You can get the gettext tools from the following sites: + + - `GNU FTP site for gettetx`_ where several versions (0.10.40, 0.11.2, 0.11.5 and 0.12.1) are available. + Note that you need to use `GNU libiconv`_ to use this. Get it from the `GNU + libiconv ftp site`_ and get version 1.9.1 or later. Get the Windows .ZIP + files and install the packages inside c:/gnu. All binaries will be stored + inside c:/gnu/bin. Just put c:/gnu/bin inside your PATH. You will need + the following files: + + - `gettext-runtime-0.12.1.bin.woe32.zip`_ + - `gettext-tools-0.12.1.bin.woe32.zip`_ + - `libiconv-1.9.1.bin.woe32.zip`_ + + +.. _GNU libiconv: http://www.gnu.org/software/libiconv/ +.. _GNU libiconv ftp site: http://www.ibiblio.org/pub/gnu/libiconv/ +.. _gettext-runtime-0.12.1.bin.woe32.zip: ftp://ftp.gnu.org/gnu/gettext/gettext-runtime-0.12.1.bin.woe32.zip +.. _gettext-tools-0.12.1.bin.woe32.zip: ftp://ftp.gnu.org/gnu/gettext/gettext-tools-0.12.1.bin.woe32.zip +.. _libiconv-1.9.1.bin.woe32.zip: http://www.ibiblio.org/pub/gnu/libiconv/libiconv-1.9.1.bin.woe32.zip + +""" +# ----------------------------------------------------------------------------- +# Module Import +# ------------- +# +import os +import sys +import wx +import re + +# ----------------------------------------------------------------------------- +# Global variables +# ---------------- +# + +__author__ = "Pierre Rouleau" +__version__= "$Revision: 1.5 $" + +# ----------------------------------------------------------------------------- + +def getlanguageDict(): + languageDict = {} + + for lang in [x for x in dir(wx) if x.startswith("LANGUAGE")]: + i = wx.Locale(wx.LANGUAGE_DEFAULT).GetLanguageInfo(getattr(wx, lang)) + if i: + languageDict[i.CanonicalName] = i.Description + + return languageDict + +XSD_STRING_MODEL = re.compile("]*\>") + +# ----------------------------------------------------------------------------- +# m a k e P O ( ) -- Build the Portable Object file for the application -- +# ^^^^^^^^^^^^^^^ +# +def makePO(applicationDirectoryPath, applicationDomain=None, verbose=0) : + """Build the Portable Object Template file for the application. + + makePO builds the .pot file for the application stored inside + a specified directory by running xgettext for all application source + files. It finds the name of all files by looking for a file called 'app.fil'. + If this file does not exists, makePo raises an IOError exception. + By default the application domain (the application + name) is the same as the directory name but it can be overridden by the + 'applicationDomain' argument. + + makePO always creates a new file called messages.pot. If it finds files + of the form app_xx.po where 'app' is the application name and 'xx' is one + of the ISO 639 two-letter language codes, makePO resynchronizes those + files with the latest extracted strings (now contained in messages.pot). + This process updates all line location number in the language-specific + .po files and may also create new entries for translation (or comment out + some). The .po file is not changed, instead a new file is created with + the .new extension appended to the name of the .po file. + + By default the function does not display what it is doing. Set the + verbose argument to 1 to force it to print its commands. + """ + + if applicationDomain is None: + applicationName = fileBaseOf(applicationDirectoryPath,withPath=0) + else: + applicationName = applicationDomain + currentDir = os.getcwd() + os.chdir(applicationDirectoryPath) + if not os.path.exists('app.fil'): + raise IOError(2,'No module file: app.fil') + + # Steps: + # Use xgettext to parse all application modules + # The following switches are used: + # + # -s : sort output by string content (easier to use when we need to merge several .po files) + # --files-from=app.fil : The list of files is taken from the file: app.fil + # --output= : specifies the name of the output file (using a .pot extension) + cmd = 'xgettext -s --no-wrap --language=Python --files-from=app.fil --output=messages.pot' + if verbose: print cmd + os.system(cmd) + + appfil_file = open("app.fil", 'r') + messages_file = open("messages.pot", 'a') + messages_file.write(""" +#: Extra XSD strings +""") + words_found = {} + for filepath in appfil_file.xreadlines(): + code_file = open(filepath.strip(), 'r') + for match in XSD_STRING_MODEL.finditer(code_file.read()): + word = match.group(1) + if not words_found.get(word, False): + words_found[word] = True + messages_file.write(""" +msgid "%s" +msgstr "" +"""%word) + code_file.close() + messages_file.close() + appfil_file.close() + + languageDict = getlanguageDict() + + for langCode in languageDict.keys(): + if langCode == 'en': + pass + else: + langPOfileName = "%s_%s.po" % (applicationName , langCode) + if os.path.exists(langPOfileName): + cmd = 'msgmerge -s --no-wrap "%s" messages.pot > "%s.new"' % (langPOfileName, langPOfileName) + if verbose: print cmd + os.system(cmd) + os.chdir(currentDir) + +# ----------------------------------------------------------------------------- +# c a t P O ( ) -- Concatenate one or several PO files with the application domain files. -- +# ^^^^^^^^^^^^^ +# +def catPO(applicationDirectoryPath, listOf_extraPo, applicationDomain=None, targetDir=None, verbose=0) : + """Concatenate one or several PO files with the application domain files. + """ + + if applicationDomain is None: + applicationName = fileBaseOf(applicationDirectoryPath,withPath=0) + else: + applicationName = applicationDomain + currentDir = os.getcwd() + os.chdir(applicationDirectoryPath) + + languageDict = getlanguageDict() + + for langCode in languageDict.keys(): + if langCode == 'en': + pass + else: + langPOfileName = "%s_%s.po" % (applicationName , langCode) + if os.path.exists(langPOfileName): + fileList = '' + for fileName in listOf_extraPo: + fileList += ("%s_%s.po " % (fileName,langCode)) + cmd = "msgcat -s --no-wrap %s %s > %s.cat" % (langPOfileName, fileList, langPOfileName) + if verbose: print cmd + os.system(cmd) + if targetDir is None: + pass + else: + mo_targetDir = "%s/%s/LC_MESSAGES" % (targetDir,langCode) + cmd = "msgfmt --output-file=%s/%s.mo %s_%s.po.cat" % (mo_targetDir,applicationName,applicationName,langCode) + if verbose: print cmd + os.system(cmd) + os.chdir(currentDir) + +# ----------------------------------------------------------------------------- +# m a k e M O ( ) -- Compile the Portable Object files into the Machine Object stored in the right location. -- +# ^^^^^^^^^^^^^^^ +# +def makeMO(applicationDirectoryPath,targetDir='./locale',applicationDomain=None, verbose=0, forceEnglish=0) : + """Compile the Portable Object files into the Machine Object stored in the right location. + + makeMO converts all translated language-specific PO files located inside + the application directory into the binary .MO files stored inside the + LC_MESSAGES sub-directory for the found locale files. + + makeMO searches for all files that have a name of the form 'app_xx.po' + inside the application directory specified by the first argument. The + 'app' is the application domain name (that can be specified by the + applicationDomain argument or is taken from the directory name). The 'xx' + corresponds to one of the ISO 639 two-letter language codes. + + makeMo stores the resulting files inside a sub-directory of `targetDir` + called xx/LC_MESSAGES where 'xx' corresponds to the 2-letter language + code. + """ + if targetDir is None: + targetDir = './locale' + if verbose: + print "Target directory for .mo files is: %s" % targetDir + + if applicationDomain is None: + applicationName = fileBaseOf(applicationDirectoryPath,withPath=0) + else: + applicationName = applicationDomain + currentDir = os.getcwd() + os.chdir(applicationDirectoryPath) + + languageDict = getlanguageDict() + + for langCode in languageDict.keys(): + if (langCode == 'en') and (forceEnglish==0): + pass + else: + langPOfileName = "%s_%s.po" % (applicationName , langCode) + if os.path.exists(langPOfileName): + mo_targetDir = "%s/%s/LC_MESSAGES" % (targetDir,langCode) + if not os.path.exists(mo_targetDir): + mkdir(mo_targetDir) + cmd = 'msgfmt --output-file="%s/%s.mo" "%s_%s.po"' % (mo_targetDir,applicationName,applicationName,langCode) + if verbose: print cmd + os.system(cmd) + os.chdir(currentDir) + +# ----------------------------------------------------------------------------- +# p r i n t U s a g e -- Displays how to use this script from the command line -- +# ^^^^^^^^^^^^^^^^^^^ +# +def printUsage(errorMsg=None) : + """Displays how to use this script from the command line.""" + print """ + ################################################################################## + # mki18n : Make internationalization files. # + # Uses the GNU gettext system to create PO (Portable Object) files # + # from source code, coimpile PO into MO (Machine Object) files. # + # Supports C,C++,Python source files. # + # # + # Usage: mki18n {OPTION} [appDirPath] # + # # + # Options: # + # -e : When -m is used, forces English .mo file creation # + # -h : prints this help # + # -m : make MO from existing PO files # + # -p : make PO, update PO files: Creates a new messages.pot # + # file. Creates a dom_xx.po.new for every existing # + # language specific .po file. ('xx' stands for the ISO639 # + # two-letter language code and 'dom' stands for the # + # application domain name). mki18n requires that you # + # write a 'app.fil' file which contains the list of all # + # source code to parse. # + # -v : verbose (prints comments while running) # + # --domain=appName : specifies the application domain name. By default # + # the directory name is used. # + # --moTarget=dir : specifies the directory where .mo files are stored. # + # If not specified, the target is './locale' # + # # + # You must specify one of the -p or -m option to perform the work. You can # + # specify the path of the target application. If you leave it out mki18n # + # will use the current directory as the application main directory. # + # # + ##################################################################################""" + if errorMsg: + print "\n ERROR: %s" % errorMsg + +# ----------------------------------------------------------------------------- +# f i l e B a s e O f ( ) -- Return base name of filename -- +# ^^^^^^^^^^^^^^^^^^^^^^^ +# +def fileBaseOf(filename,withPath=0) : + """fileBaseOf(filename,withPath) ---> string + + Return base name of filename. The returned string never includes the extension. + Use os.path.basename() to return the basename with the extension. The + second argument is optional. If specified and if set to 'true' (non zero) + the string returned contains the full path of the file name. Otherwise the + path is excluded. + + [Example] + >>> fn = 'd:/dev/telepath/tvapp/code/test.html' + >>> fileBaseOf(fn) + 'test' + >>> fileBaseOf(fn) + 'test' + >>> fileBaseOf(fn,1) + 'd:/dev/telepath/tvapp/code/test' + >>> fileBaseOf(fn,0) + 'test' + >>> fn = 'abcdef' + >>> fileBaseOf(fn) + 'abcdef' + >>> fileBaseOf(fn,1) + 'abcdef' + >>> fn = "abcdef." + >>> fileBaseOf(fn) + 'abcdef' + >>> fileBaseOf(fn,1) + 'abcdef' + """ + pos = filename.rfind('.') + if pos > 0: + filename = filename[:pos] + if withPath: + return filename + else: + return os.path.basename(filename) +# ----------------------------------------------------------------------------- +# m k d i r ( ) -- Create a directory (and possibly the entire tree) -- +# ^^^^^^^^^^^^^ +# +def mkdir(directory) : + """Create a directory (and possibly the entire tree). + + The os.mkdir() will fail to create a directory if one of the + directory in the specified path does not exist. mkdir() + solves this problem. It creates every intermediate directory + required to create the final path. Under Unix, the function + only supports forward slash separator, but under Windows and MacOS + the function supports the forward slash and the OS separator (backslash + under windows). + """ + + # translate the path separators + directory = unixpath(directory) + # build a list of all directory elements + aList = filter(lambda x: len(x)>0, directory.split('/')) + theLen = len(aList) + # if the first element is a Windows-style disk drive + # concatenate it with the first directory + if aList[0].endswith(':'): + if theLen > 1: + aList[1] = aList[0] + '/' + aList[1] + del aList[0] + theLen -= 1 + # if the original directory starts at root, + # make sure the first element of the list + # starts at root too + if directory[0] == '/': + aList[0] = '/' + aList[0] + # Now iterate through the list, check if the + # directory exists and if not create it + theDir = '' + for i in range(theLen): + theDir += aList[i] + if not os.path.exists(theDir): + os.mkdir(theDir) + theDir += '/' + +# ----------------------------------------------------------------------------- +# u n i x p a t h ( ) -- Return a path name that contains Unix separator. -- +# ^^^^^^^^^^^^^^^^^^^ +# +def unixpath(thePath) : + r"""Return a path name that contains Unix separator. + + [Example] + >>> unixpath(r"d:\test") + 'd:/test' + >>> unixpath("d:/test/file.txt") + 'd:/test/file.txt' + >>> + """ + thePath = os.path.normpath(thePath) + if os.sep == '/': + return thePath + else: + return thePath.replace(os.sep,'/') + +# ----------------------------------------------------------------------------- + +# S c r i p t e x e c u t i o n -- Runs when invoked from the command line -- +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +if __name__ == "__main__": + import getopt # command line parsing + argc = len(sys.argv) + if argc == 1: + printUsage('Missing argument: specify at least one of -m or -p (or both).') + sys.exit(1) + # If there is some arguments, parse the command line + validOptions = "ehmpv" + validLongOptions = ['domain=', 'moTarget='] + option = {} + option['forceEnglish'] = 0 + option['mo'] = 0 + option['po'] = 0 + option['verbose'] = 0 + option['domain'] = None + option['moTarget'] = None + try: + optionList,pargs = getopt.getopt(sys.argv[1:],validOptions,validLongOptions) + except getopt.GetoptError, e: + printUsage(e[0]) + sys.exit(1) + for (opt,val) in optionList: + if (opt == '-h'): + printUsage() + sys.exit(0) + elif (opt == '-e'): option['forceEnglish'] = 1 + elif (opt == '-m'): option['mo'] = 1 + elif (opt == '-p'): option['po'] = 1 + elif (opt == '-v'): option['verbose'] = 1 + elif (opt == '--domain'): option['domain'] = val + elif (opt == '--moTarget'): option['moTarget'] = val + if len(pargs) == 0: + appDirPath = os.getcwd() + if option['verbose']: + print "No project directory given. Using current one: %s" % appDirPath + elif len(pargs) == 1: + appDirPath = pargs[0] + else: + printUsage('Too many arguments (%u). Use double quotes if you have space in directory name' % len(pargs)) + sys.exit(1) + if option['domain'] is None: + # If no domain specified, use the name of the target directory + option['domain'] = fileBaseOf(appDirPath) + if option['verbose']: + print "Application domain used is: '%s'" % option['domain'] + if option['po']: + try: + makePO(appDirPath,option['domain'],option['verbose']) + except IOError, e: + printUsage(e[1] + '\n You must write a file app.fil that contains the list of all files to parse.') + if option['mo']: + makeMO(appDirPath,option['moTarget'],option['domain'],option['verbose'],option['forceEnglish']) + sys.exit(1) + + +# ----------------------------------------------------------------------------- diff -r 32339ad7d9ae -r 331d698e1118 locale/fr_FR/LC_MESSAGES/Beremiz.mo Binary file locale/fr_FR/LC_MESSAGES/Beremiz.mo has changed diff -r 32339ad7d9ae -r 331d698e1118 locale/zh_CN/LC_MESSAGES/Beremiz.mo Binary file locale/zh_CN/LC_MESSAGES/Beremiz.mo has changed diff -r 32339ad7d9ae -r 331d698e1118 plugger.py --- a/plugger.py Mon Jul 20 16:28:56 2009 +0200 +++ b/plugger.py Tue Jul 28 17:43:19 2009 +0200 @@ -199,7 +199,7 @@ # Call the plugin specific OnPlugSave method result = self.OnPlugSave() if not result: - return "Error while saving \"%s\"\n"%self.PlugPath() + return _("Error while saving \"%s\"\n")%self.PlugPath() # mark plugin as saved self.ChangesToSave = False @@ -235,7 +235,7 @@ gen_result = self.PlugGenerate_C(buildpath, locations) PlugCFilesAndCFLAGS, PlugLDFLAGS, DoCalls = gen_result[:3] extra_files = gen_result[3:] - # if some files heve been generated put them in the list with their location + # if some files have been generated put them in the list with their location if PlugCFilesAndCFLAGS: LocationCFilesAndCFLAGS = [(self.GetCurrentLocation(), PlugCFilesAndCFLAGS, DoCalls)] else: @@ -392,7 +392,7 @@ shutil.move(oldname, self.PlugPath()) # warn user he has two left hands if DesiredName != res: - self.logger.write_warning("A child names \"%s\" already exist -> \"%s\"\n"%(DesiredName,res)) + self.logger.write_warning(_("A child names \"%s\" already exist -> \"%s\"\n")%(DesiredName,res)) return res def FindNewIEC_Channel(self, DesiredChannel): @@ -417,14 +417,14 @@ if res < CurrentChannel: # Want to go down ? res -= 1 # Test for n-1 if res < 0 : - self.logger.write_warning("Cannot find lower free IEC channel than %d\n"%CurrentChannel) + self.logger.write_warning(_("Cannot find lower free IEC channel than %d\n")%CurrentChannel) return CurrentChannel # Can't go bellow 0, do nothing else : # Want to go up ? res += 1 # Test for n-1 # Finally set IEC Channel self.BaseParams.setIEC_Channel(res) if DesiredChannel != res: - self.logger.write_warning("A child with IEC channel %d already exist -> %d\n"%(DesiredChannel,res)) + self.logger.write_warning(_("A child with IEC channel %d already exist -> %d\n")%(DesiredChannel,res)) return res def OnPlugClose(self): @@ -462,7 +462,7 @@ try: PlugClass, PlugHelp = PlugChildsTypes[PlugType] except KeyError: - raise Exception, "Cannot create child %s of type %s "%(PlugName, PlugType) + raise Exception, _("Cannot create child %s of type %s ")%(PlugName, PlugType) # if PlugClass is a class factory, call it. (prevent unneeded imports) if type(PlugClass) == types.FunctionType: @@ -472,7 +472,7 @@ PluggedChildsWithSameClass = self.PluggedChilds.setdefault(PlugType, list()) # Check count if getattr(PlugClass, "PlugMaxCount", None) and len(PluggedChildsWithSameClass) >= PlugClass.PlugMaxCount: - raise Exception, "Max count (%d) reached for this plugin of type %s "%(PlugClass.PlugMaxCount, PlugType) + raise Exception, _("Max count (%d) reached for this plugin of type %s ")%(PlugClass.PlugMaxCount, PlugType) # create the final class, derived of provided plugin and template class FinalPlugClass(PlugClass, PlugTemplate): @@ -500,7 +500,7 @@ _self.LoadXMLParams(NewPlugName) # Basic check. Better to fail immediately. if (_self.BaseParams.getName() != NewPlugName): - raise Exception, "Project tree layout do not match plugin.xml %s!=%s "%(NewPlugName, _self.BaseParams.getName()) + raise Exception, _("Project tree layout do not match plugin.xml %s!=%s ")%(NewPlugName, _self.BaseParams.getName()) # Now, self.PlugPath() should be OK @@ -555,7 +555,7 @@ self.MandatoryParams[1].loadXMLTree(basetree.childNodes[0]) basexmlfile.close() except Exception, exc: - self.logger.write_error("Couldn't load plugin base parameters %s :\n %s" % (PlugName, str(exc))) + self.logger.write_error(_("Couldn't load plugin base parameters %s :\n %s") % (PlugName, str(exc))) self.logger.write_error(traceback.format_exc()) # Get the xml tree @@ -566,7 +566,7 @@ self.PlugParams[1].loadXMLTree(tree.childNodes[0]) xmlfile.close() except Exception, exc: - self.logger.write_error("Couldn't load plugin parameters %s :\n %s" % (PlugName, str(exc))) + self.logger.write_error(_("Couldn't load plugin parameters %s :\n %s") % (PlugName, str(exc))) self.logger.write_error(traceback.format_exc()) def LoadChilds(self): @@ -578,7 +578,7 @@ try: self.PlugAddChild(pname, ptype) except Exception, exc: - self.logger.write_error("Could not add child \"%s\", type %s :\n%s\n"%(pname, ptype, str(exc))) + self.logger.write_error(_("Could not add child \"%s\", type %s :\n%s\n")%(pname, ptype, str(exc))) self.logger.write_error(traceback.format_exc()) def EnableMethod(self, method, value): @@ -777,7 +777,7 @@ """ # Verify that choosen folder is empty if not os.path.isdir(ProjectPath) or len(os.listdir(ProjectPath)) > 0: - return "Folder choosen isn't empty. You can't use it for a new project!" + return _("Folder choosen isn't empty. You can't use it for a new project!") dialog = ProjectDialog(self.AppFrame) if dialog.ShowModal() == wx.ID_OK: @@ -786,7 +786,7 @@ dialog.Destroy() else: dialog.Destroy() - return "Project not created" + return _("Project not created") # Create PLCOpen program self.CreateNewProject(values) @@ -812,7 +812,7 @@ # Verify that project contains a PLCOpen program plc_file = os.path.join(ProjectPath, "plc.xml") if not os.path.isfile(plc_file): - return "Folder choosen doesn't contain a program. It's not a valid project!" + return _("Folder choosen doesn't contain a program. It's not a valid project!") # Load PLCOpen file result = self.OpenXMLFile(plc_file) if result: @@ -928,17 +928,17 @@ # Update PLCOpenEditor Plugin Block types before generate ST code self.RefreshPluginsBlockLists() - self.logger.write("Generating SoftPLC IEC-61131 ST/IL/SFC code...\n") + self.logger.write(_("Generating SoftPLC IEC-61131 ST/IL/SFC code...\n")) buildpath = self._getBuildPath() # ask PLCOpenEditor controller to write ST/IL/SFC code file program, errors, warnings = self.GenerateProgram(self._getIECgeneratedcodepath()) if len(warnings) > 0: - self.logger.write_warning("Warnings in ST/IL/SFC code generator :\n") + self.logger.write_warning(_("Warnings in ST/IL/SFC code generator :\n")) for warning in warnings: self.logger.write_warning("%s\n"%warning) if len(errors) > 0: # Failed ! - self.logger.write_error("Error in ST/IL/SFC code generator :\n%s\n"%errors[0]) + self.logger.write_error(_("Error in ST/IL/SFC code generator :\n%s\n")%errors[0]) return False plc_file = open(self._getIECcodepath(), "w") if getattr(self, "PluggedChilds", None) is not None: @@ -960,7 +960,7 @@ plc_file = open(self._getIECcodepath(), "a") plc_file.write(open(self._getIECgeneratedcodepath(), "r").read()) plc_file.close() - self.logger.write("Compiling IEC Program in to C code...\n") + self.logger.write(_("Compiling IEC Program in to C code...\n")) # Now compile IEC code into many C files # files are listed to stdout, and errors to stderr. status, result, err_result = ProcessLogger( @@ -999,7 +999,7 @@ f.close() - self.logger.write_error("Error : IEC to C compiler returned %d\n"%status) + self.logger.write_error(_("Error : IEC to C compiler returned %d\n")%status) return False # Now extract C files of stdout @@ -1007,11 +1007,11 @@ # remove those that are not to be compiled because included by others C_files.remove("POUS.c") if not C_files: - self.logger.write_error("Error : At least one configuration and one ressource must be declared in PLC !\n") + self.logger.write_error(_("Error : At least one configuration and one ressource must be declared in PLC !\n")) return False # transform those base names to full names with path C_files = map(lambda filename:os.path.join(buildpath, filename), C_files) - self.logger.write("Extracting Located Variables...\n") + self.logger.write(_("Extracting Located Variables...\n")) # Keep track of generated located variables for later use by self._Generate_C self.PLCGeneratedLocatedVars = self.GetLocations() # Keep track of generated C files for later use by self.PlugGenerate_C @@ -1034,7 +1034,7 @@ targetmodule = getattr(__import__(modulename), targetname) except Exception, msg: - self.logger.write_error("Can't find module for target %s!\n"%targetname) + self.logger.write_error(_("Can't find module for target %s!\n")%targetname) self.logger.write_error(str(msg)) return None @@ -1158,7 +1158,7 @@ Idx=int(attrs["num"]) self._IECPathToIdx[IEC_path]=Idx except Exception,e: - self.logger.write_error("Cannot open/parse VARIABLES.csv!\n") + self.logger.write_error(_("Cannot open/parse VARIABLES.csv!\n")) self.logger.write_error(traceback.format_exc()) self.ResetIECProgramsAndVariables() return False @@ -1270,7 +1270,7 @@ self.EnableMethod("_Clean", True) self.logger.flush() - self.logger.write("Start build in %s\n" % buildpath) + self.logger.write(_("Start build in %s\n") % buildpath) # Generate SoftPLC IEC code IECGenRes = self._Generate_SoftPLC() @@ -1278,7 +1278,7 @@ # If IEC code gen fail, bail out. if not IECGenRes: - self.logger.write_error("IEC-61131-3 code generation failed !\n") + self.logger.write_error(_("IEC-61131-3 code generation failed !\n")) return False # Reset variable and program list that are parsed from @@ -1286,17 +1286,17 @@ self.ResetIECProgramsAndVariables() # Generate C code and compilation params from plugin hierarchy - self.logger.write("Generating plugins C code\n") + self.logger.write(_("Generating plugins C code\n")) try: self.LocationCFilesAndCFLAGS, self.LDFLAGS, ExtraFiles = self._Generate_C( buildpath, self.PLCGeneratedLocatedVars) except Exception, exc: - self.logger.write_error("Plugins code generation failed !\n") + self.logger.write_error(_("Plugins code generation failed !\n")) self.logger.write_error(traceback.format_exc()) return False - # Get temprary directory path + # Get temporary directory path extrafilespath = self._getExtraFilesPath() # Remove old directory if os.path.exists(extrafilespath): @@ -1329,25 +1329,25 @@ # Insert this file as first file to be compiled at root plugin self.LocationCFilesAndCFLAGS[0][1].insert(0,(code_path, self.plcCFLAGS)) except Exception, exc: - self.logger.write_error(name+" generation failed !\n") + self.logger.write_error(name+_(" generation failed !\n")) self.logger.write_error(traceback.format_exc()) return False - self.logger.write("C code generated successfully.\n") + self.logger.write(_("C code generated successfully.\n")) # Get current or fresh builder builder = self.GetBuilder() if builder is None: - self.logger.write_error("Fatal : cannot get builder.\n") + self.logger.write_error(_("Fatal : cannot get builder.\n")) return False # Build try: if not builder.build() : - self.logger.write_error("C Build failed.\n") + self.logger.write_error(_("C Build failed.\n")) return False except Exception, exc: - self.logger.write_error("C Build crashed !\n") + self.logger.write_error(_("C Build crashed !\n")) self.logger.write_error(traceback.format_exc()) return False @@ -1428,10 +1428,10 @@ def _Clean(self): if os.path.isdir(os.path.join(self._getBuildPath())): - self.logger.write("Cleaning the build directory\n") + self.logger.write(_("Cleaning the build directory\n")) shutil.rmtree(os.path.join(self._getBuildPath())) else: - self.logger.write_error("Build directory already clean\n") + self.logger.write_error(_("Build directory already clean\n")) self.ShowMethod("_showIECcode", False) self.EnableMethod("_Clean", False) # kill the builder @@ -1446,28 +1446,29 @@ status = self._connector.GetPLCstatus() else: status = "Disconnected" + _ = lambda x : x for args in { - "Started":[("_Run", False), - ("_Debug", False), - ("_Stop", True)], - "Stopped":[("_Run", True), - ("_Debug", True), - ("_Stop", False)], - "Empty": [("_Run", False), - ("_Debug", False), - ("_Stop", False)], - "Dirty": [("_Run", True), - ("_Debug", True), - ("_Stop", False)], - "Broken": [("_Run", True), - ("_Debug", True), - ("_Stop", False)], - "Disconnected": [("_Run", False), - ("_Debug", False), - ("_Stop", False), - ("_Transfer", False), - ("_Connect", True), - ("_Disconnect", False)], + _("Started"): [("_Run", False), + ("_Debug", False), + ("_Stop", True)], + _("Stopped"): [("_Run", True), + ("_Debug", True), + ("_Stop", False)], + _("Empty"): [("_Run", False), + ("_Debug", False), + ("_Stop", False)], + _("Dirty"): [("_Run", True), + ("_Debug", True), + ("_Stop", False)], + _("Broken"): [("_Run", True), + ("_Debug", True), + ("_Stop", False)], + _("Disconnected"):[("_Run", False), + ("_Debug", False), + ("_Stop", False), + ("_Transfer", False), + ("_Connect", True), + ("_Disconnect", False)], }.get(status,[]): self.ShowMethod(*args) return status @@ -1478,7 +1479,11 @@ current_status = self.UpdateMethodsFromPLCStatus() if current_status != self.previous_plcstate: self.previous_plcstate = current_status - self.StatusPrint.get(current_status, self.logger.write)("PLC is %s\n"%current_status) + if current_status is not None: + status = _(current_status) + else: + status = "" + self.StatusPrint.get(current_status, self.logger.write)(_("PLC is %s\n")%status) self.AppFrame.RefreshAll() def _Run(self): @@ -1509,7 +1514,7 @@ Idxs.append(Idx) self.TracedIECPath.append(IECPath) else: - self.logger.write_warning("Debug : Unknown variable %s\n"%IECPath) + self.logger.write_warning(_("Debug : Unknown variable %s\n")%IECPath) for IECPathToPop in IECPathsToPop: self.IECdebug_datas.pop(IECPathToPop) @@ -1604,12 +1609,12 @@ self.CallWeakcallables("__tick__", "NewDataAvailable") elif debug_vars is not None: wx.CallAfter(self.logger.write_warning, - "Debug data not coherent %d != %d\n"%(len(debug_vars), len(self.TracedIECPath))) + _("Debug data not coherent %d != %d\n")%(len(debug_vars), len(self.TracedIECPath))) elif debug_tick == -1: #wx.CallAfter(self.logger.write, "Debugger unavailable\n") pass else: - wx.CallAfter(self.logger.write, "Debugger disabled\n") + wx.CallAfter(self.logger.write, _("Debugger disabled\n")) self.debug_break = True self.IECdebug_lock.release() @@ -1617,7 +1622,7 @@ self.debug_break = True self.DebugThread.join(timeout=1) if self.DebugThread.isAlive(): - self.logger.write_warning("Debug Thread couldn't be killed") + self.logger.write_warning(_("Debug Thread couldn't be killed")) self.DebugThread = None def _Debug(self): @@ -1626,7 +1631,7 @@ """ if self.GetIECProgramsAndVariables(): self._connector.StartPLC(debug=True) - self.logger.write("Starting PLC (debug mode)\n") + self.logger.write(_("Starting PLC (debug mode)\n")) if self.PLCDebug is None: self.RefreshPluginsBlockLists() def _onclose(): @@ -1639,7 +1644,7 @@ self.DebugThread = Thread(target=self.DebugThreadProc) self.DebugThread.start() else: - self.logger.write_error("Couldn't start PLC debug !\n") + self.logger.write_error(_("Couldn't start PLC debug !\n")) self.UpdateMethodsFromPLCStatus() @@ -1665,17 +1670,17 @@ Stop PLC """ if self.DebugThread is not None: - self.logger.write("Stopping debug\n") + self.logger.write(_("Stopping debug\n")) self.KillDebugThread() if not self._connector.StopPLC(): - self.logger.write_error("Couldn't stop PLC !\n") + self.logger.write_error(_("Couldn't stop PLC !\n")) self.UpdateMethodsFromPLCStatus() def _Connect(self): # don't accept re-connetion is already connected if self._connector is not None: - self.logger.write_error("Already connected. Please disconnect\n") + self.logger.write_error(_("Already connected. Please disconnect\n")) return # Get connector uri @@ -1702,13 +1707,13 @@ try: self._connector = connectors.ConnectorFactory(uri, self) except Exception, msg: - self.logger.write_error("Exception while connecting %s!\n"%uri) + self.logger.write_error(_("Exception while connecting %s!\n")%uri) self.logger.write_error(traceback.format_exc()) # Did connection success ? if self._connector is None: # Oups. - self.logger.write_error("Connection failed to %s!\n"%uri) + self.logger.write_error(_("Connection failed to %s!\n")%uri) else: self.ShowMethod("_Connect", False) self.ShowMethod("_Disconnect", True) @@ -1718,7 +1723,11 @@ # Init with actual PLC status and print it self.previous_plcstate = self.UpdateMethodsFromPLCStatus() - self.logger.write("PLC is %s\n"%self.previous_plcstate) + if self.previous_plcstate is not None: + status = _(self.previous_plcstate) + else: + status = "" + self.logger.write(_("PLC is %s\n")%status) # Start the status Timer self.StatusTimer.Start(milliseconds=500, oneShot=False) @@ -1732,16 +1741,16 @@ if MD5 is not None: if not self._connector.MatchMD5(MD5): self.logger.write_warning( - "Latest build do not match with target, please transfer.\n") + _("Latest build do not match with target, please transfer.\n")) self.EnableMethod("_Transfer", True) else: self.logger.write( - "Latest build match target, no transfer needed.\n") + _("Latest build match target, no transfer needed.\n")) self.EnableMethod("_Transfer", True) #self.EnableMethod("_Transfer", False) else: self.logger.write_warning( - "Cannot compare latest build to target. Please build.\n") + _("Cannot compare latest build to target. Please build.\n")) self.EnableMethod("_Transfer", False) @@ -1756,13 +1765,13 @@ # Check if md5 file is empty : ask user to build PLC if MD5 is None : - self.logger.write_error("Failed : Must build before transfer.\n") + self.logger.write_error(_("Failed : Must build before transfer.\n")) return False # Compare PLC project with PLC on target if self._connector.MatchMD5(MD5): self.logger.write( - "Latest build already match current target. Transfering anyway...\n") + _("Latest build already match current target. Transfering anyway...\n")) # Get temprary directory path extrafilespath = self._getExtraFilesPath() @@ -1782,68 +1791,68 @@ self.PLCDebug = None self.UnsubscribeAllDebugIECVariable() self.ProgramTransferred() - self.logger.write("Transfer completed successfully.\n") + self.logger.write(_("Transfer completed successfully.\n")) else: - self.logger.write_error("Transfer failed\n") + self.logger.write_error(_("Transfer failed\n")) else: - self.logger.write_error("No PLC to transfer (did build success ?)\n") + self.logger.write_error(_("No PLC to transfer (did build success ?)\n")) self.UpdateMethodsFromPLCStatus() PluginMethods = [ {"bitmap" : opjimg("editPLC"), - "name" : "Edit PLC", - "tooltip" : "Edit PLC program with PLCOpenEditor", + "name" : _("Edit PLC"), + "tooltip" : _("Edit PLC program with PLCOpenEditor"), "method" : "_EditPLC"}, {"bitmap" : opjimg("Build"), - "name" : "Build", - "tooltip" : "Build project into build folder", + "name" : _("Build"), + "tooltip" : _("Build project into build folder"), "method" : "_build"}, {"bitmap" : opjimg("Clean"), - "name" : "Clean", + "name" : _("Clean"), "enabled" : False, - "tooltip" : "Clean project build folder", + "tooltip" : _("Clean project build folder"), "method" : "_Clean"}, {"bitmap" : opjimg("Run"), - "name" : "Run", + "name" : _("Run"), "shown" : False, - "tooltip" : "Start PLC", + "tooltip" : _("Start PLC"), "method" : "_Run"}, {"bitmap" : opjimg("Debug"), - "name" : "Debug", + "name" : _("Debug"), "shown" : False, - "tooltip" : "Start PLC (debug mode)", + "tooltip" : _("Start PLC (debug mode)"), "method" : "_Debug"}, # {"bitmap" : opjimg("Debug"), # "name" : "Do_Test_Debug", # "tooltip" : "Test debug mode)", # "method" : "_Do_Test_Debug"}, {"bitmap" : opjimg("Stop"), - "name" : "Stop", + "name" : _("Stop"), "shown" : False, - "tooltip" : "Stop Running PLC", + "tooltip" : _("Stop Running PLC"), "method" : "_Stop"}, {"bitmap" : opjimg("Connect"), - "name" : "Connect", - "tooltip" : "Connect to the target PLC", + "name" : _("Connect"), + "tooltip" : _("Connect to the target PLC"), "method" : "_Connect"}, {"bitmap" : opjimg("Transfer"), - "name" : "Transfer", + "name" : _("Transfer"), "shown" : False, - "tooltip" : "Transfer PLC", + "tooltip" : _("Transfer PLC"), "method" : "_Transfer"}, {"bitmap" : opjimg("Disconnect"), - "name" : "Disconnect", + "name" : _("Disconnect"), "shown" : False, - "tooltip" : "Disconnect from PLC", + "tooltip" : _("Disconnect from PLC"), "method" : "_Disconnect"}, {"bitmap" : opjimg("ShowIECcode"), - "name" : "Show code", + "name" : _("Show code"), "shown" : False, - "tooltip" : "Show IEC code generated by PLCGenerator", + "tooltip" : _("Show IEC code generated by PLCGenerator"), "method" : "_showIECcode"}, {"bitmap" : opjimg("editIECrawcode"), - "name" : "Raw IEC code", - "tooltip" : "Edit raw IEC code added to code generated by PLCGenerator", + "name" : _("Raw IEC code"), + "tooltip" : _("Edit raw IEC code added to code generated by PLCGenerator"), "method" : "_editIECrawcode"}, {"bitmap" : opjimg("editPYTHONcode"), "name" : "Python code", diff -r 32339ad7d9ae -r 331d698e1118 plugins/c_ext/c_ext.py --- a/plugins/c_ext/c_ext.py Mon Jul 20 16:28:56 2009 +0200 +++ b/plugins/c_ext/c_ext.py Tue Jul 28 17:43:19 2009 +0200 @@ -201,8 +201,8 @@ PluginMethods = [ {"bitmap" : os.path.join("images", "EditCfile"), - "name" : "Edit C File", - "tooltip" : "Edit C File", + "name" : _("Edit C File"), + "tooltip" : _("Edit C File"), "method" : "_OpenView"}, ] diff -r 32339ad7d9ae -r 331d698e1118 plugins/canfestival/canfestival.py --- a/plugins/canfestival/canfestival.py Mon Jul 20 16:28:56 2009 +0200 +++ b/plugins/canfestival/canfestival.py Tue Jul 28 17:43:19 2009 +0200 @@ -183,12 +183,12 @@ buildpath = self._getBuildPath() # Eventually create build dir if not os.path.exists(buildpath): - self.logger.write_error("Error: No PLC built\n") + self.logger.write_error(_("Error: No PLC built\n")) return masterpath = os.path.join(buildpath, "MasterGenerated.od") if not os.path.exists(masterpath): - self.logger.write_error("Error: No Master generated\n") + self.logger.write_error(_("Error: No Master generated\n")) return new_dialog = objdictedit(None, filesOpen=[masterpath]) @@ -196,11 +196,11 @@ PluginMethods = [ {"bitmap" : os.path.join("images", "NetworkEdit"), - "name" : "Edit network", - "tooltip" : "Edit CanOpen Network with NetworkEdit", + "name" : _("Edit network"), + "tooltip" : _("Edit CanOpen Network with NetworkEdit"), "method" : "_OpenView"}, - {"name" : "Show Master", - "tooltip" : "Show Master generated by config_utils", + {"name" : _("Show Master"), + "tooltip" : _("Show Master generated by config_utils"), "method" : "_ShowMasterGenerated"} ] diff -r 32339ad7d9ae -r 331d698e1118 plugins/canfestival/config_utils.py --- a/plugins/canfestival/config_utils.py Mon Jul 20 16:28:56 2009 +0200 +++ b/plugins/canfestival/config_utils.py Tue Jul 28 17:43:19 2009 +0200 @@ -332,13 +332,13 @@ name = location["NAME"] if name in self.IECLocations: if self.IECLocations[name]["type"] != COlocationtype: - raise PDOmappingException, "Conflict type for location \"%s\"" % name + raise PDOmappingException, _("Conflict type for location \"%s\"") % name else: # Get only the part of the location that concern this node loc = location["LOC"][len(current_location):] # loc correspond to (ID, INDEX, SUBINDEX [,BIT]) if len(loc) not in (2, 3, 4): - raise PDOmappingException, "Bad location size : %s"%str(loc) + raise PDOmappingException, _("Bad location size : %s") % str(loc) elif len(loc) == 2: continue @@ -351,14 +351,14 @@ # Check Id is in slave node list if nodeid not in self.NodeList.SlaveNodes.keys(): - raise PDOmappingException, "Non existing node ID : %d (variable %s)" % (nodeid,name) + raise PDOmappingException, _("Non existing node ID : %d (variable %s)") % (nodeid,name) # Get the model for this node (made from EDS) node = self.NodeList.SlaveNodes[nodeid]["Node"] # Extract and check index and subindex if not node.IsEntry(index, subindex): - raise PDOmappingException, "No such index/subindex (%x,%x) in ID : %d (variable %s)" % (index,subindex,nodeid,name) + raise PDOmappingException, _("No such index/subindex (%x,%x) in ID : %d (variable %s)") % (index,subindex,nodeid,name) # Get the entry info subentry_infos = node.GetSubentryInfos(index, subindex) @@ -368,19 +368,19 @@ if sizelocation == "X" and len(loc) > 3: numbit = loc[3] elif sizelocation != "X" and len(loc) > 3: - raise PDOmappingException, "Cannot set bit offset for non bool '%s' variable (ID:%d,Idx:%x,sIdx:%x))" % (name,nodeid,index,subindex) + raise PDOmappingException, _("Cannot set bit offset for non bool '%s' variable (ID:%d,Idx:%x,sIdx:%x))") % (name,nodeid,index,subindex) else: numbit = None if location["IEC_TYPE"] != "BOOL" and subentry_infos["type"] != COlocationtype: - raise PDOmappingException, "Invalid type \"%s\"-> %d != %d for location\"%s\"" % (location["IEC_TYPE"], COlocationtype, subentry_infos["type"] , name) + raise PDOmappingException, _("Invalid type \"%s\"-> %d != %d for location\"%s\"") % (location["IEC_TYPE"], COlocationtype, subentry_infos["type"] , name) typeinfos = node.GetEntryInfos(COlocationtype) self.IECLocations[name] = {"type":COlocationtype, "pdotype":SlavePDOType[direction], "nodeid": nodeid, "index": index,"subindex": subindex, "bit": numbit, "size": typeinfos["size"], "sizelocation": sizelocation} else: - raise PDOmappingException, "Not PDO mappable variable : '%s' (ID:%d,Idx:%x,sIdx:%x))" % (name,nodeid,index,subindex) + raise PDOmappingException, _("Not PDO mappable variable : '%s' (ID:%d,Idx:%x,sIdx:%x))") % (name,nodeid,index,subindex) #------------------------------------------------------------------------------- # Search for locations already mapped @@ -452,7 +452,7 @@ pdomapping = [] result = self.GetEmptyPDO(nodeid, pdotype) if result is None: - raise PDOmappingException, "Impossible to define PDO mapping for node %02x"%nodeid + raise PDOmappingException, _("Impossible to define PDO mapping for node %02x") % nodeid pdoindex, pdocobid, pdonbparams = result for name, loc_infos in locations[pdotype]: pdosize += loc_infos["size"] @@ -466,7 +466,7 @@ pdomapping = [(name, loc_infos)] result = self.GetEmptyPDO(nodeid, pdotype, pdoindex + 1) if result is None: - raise PDOmappingException, "Impossible to define PDO mapping for node %02x"%nodeid + raise PDOmappingException, _("Impossible to define PDO mapping for node %02x") % nodeid pdoindex, pdocobid, pdonbparams = result else: pdomapping.append((name, loc_infos)) @@ -614,13 +614,13 @@ name = location["NAME"] if name in IECLocations: if IECLocations[name] != COlocationtype: - raise PDOmappingException, "Conflict type for location \"%s\"" % name + raise PDOmappingException, _("Conflict type for location \"%s\"") % name else: # Get only the part of the location that concern this node loc = location["LOC"][len(current_location):] # loc correspond to (ID, INDEX, SUBINDEX [,BIT]) if len(loc) not in (2, 3, 4): - raise PDOmappingException, "Bad location size : %s"%str(loc) + raise PDOmappingException, _("Bad location size : %s") % str(loc) elif len(loc) != 2: continue @@ -629,12 +629,12 @@ # Extract and check index and subindex if not slave.IsEntry(index, subindex): - raise PDOmappingException, "No such index/subindex (%x,%x) (variable %s)" % (index, subindex, name) + raise PDOmappingException, _("No such index/subindex (%x,%x) (variable %s)") % (index, subindex, name) # Get the entry info subentry_infos = slave.GetSubentryInfos(index, subindex) if subentry_infos["type"] != COlocationtype: - raise PDOmappingException, "Invalid type \"%s\"-> %d != %d for location\"%s\"" % (location["IEC_TYPE"], COlocationtype, subentry_infos["type"] , name) + raise PDOmappingException, _("Invalid type \"%s\"-> %d != %d for location\"%s\"") % (location["IEC_TYPE"], COlocationtype, subentry_infos["type"] , name) IECLocations[name] = COlocationtype pointers[(index, subindex)] = name diff -r 32339ad7d9ae -r 331d698e1118 runtime/PLCObject.py --- a/runtime/PLCObject.py Mon Jul 20 16:28:56 2009 +0200 +++ b/runtime/PLCObject.py Tue Jul 28 17:43:19 2009 +0200 @@ -216,7 +216,7 @@ self.hmi_frame.Show() def OnCloseFrame(evt): - wx.MessageBox("Please stop PLC to close") + wx.MessageBox(_("Please stop PLC to close")) create_frame() break except: diff -r 32339ad7d9ae -r 331d698e1118 targets/Xenomai/__init__.py --- a/targets/Xenomai/__init__.py Mon Jul 20 16:28:56 2009 +0200 +++ b/targets/Xenomai/__init__.py Tue Jul 28 17:43:19 2009 +0200 @@ -13,7 +13,7 @@ status, result, err_result = ProcessLogger(self.logger, xeno_config + " --xeno-ldflags", no_stdout=True).spin() if status: - self.logger.write_error("Unable to get Xenomai's LDFLAGS\n") + self.logger.write_error(_("Unable to get Xenomai's LDFLAGS\n")) xeno_ldlags = result.strip() return toolchain_gcc.getBuilderLDFLAGS(self) + [xeno_ldlags, "-shared", "-lnative"] @@ -24,7 +24,7 @@ status, result, err_result = ProcessLogger(self.logger, xeno_config + " --xeno-cflags", no_stdout=True).spin() if status: - self.logger.write_error("Unable to get Xenomai's CFLAGS\n") + self.logger.write_error(_("Unable to get Xenomai's CFLAGS\n")) xeno_cflags = result.strip() return toolchain_gcc.getBuilderCFLAGS(self) + [xeno_cflags] diff -r 32339ad7d9ae -r 331d698e1118 targets/toolchain_gcc.py --- a/targets/toolchain_gcc.py Mon Jul 20 16:28:56 2009 +0200 +++ b/targets/toolchain_gcc.py Tue Jul 28 17:43:19 2009 +0200 @@ -90,9 +90,9 @@ relink = False for Location, CFilesAndCFLAGS, DoCalls in self.PluginsRootInstance.LocationCFilesAndCFLAGS: if Location: - self.logger.write("Plugin : " + self.PluginsRootInstance.GetChildByIECLocation(Location).GetCurrentName() + " " + str(Location)+"\n") + self.logger.write(_("Plugin : ") + self.PluginsRootInstance.GetChildByIECLocation(Location).GetCurrentName() + " " + str(Location)+"\n") else: - self.logger.write("PLC :\n") + self.logger.write(_("PLC :\n")) for CFile, CFLAGS in CFilesAndCFLAGS: bn = os.path.basename(CFile) @@ -116,7 +116,7 @@ if status : self.srcmd5.pop(bn) - self.logger.write_error("C compilation of "+ bn +" failed.\n") + self.logger.write_error(_("C compilation of %s failed.\n")%bn) return False obns.append(obn) @@ -124,7 +124,7 @@ ######### GENERATE library FILE ######################################## # Link all the object files into one binary file - self.logger.write("Linking :\n") + self.logger.write(_("Linking :\n")) if relink: objstring = [] diff -r 32339ad7d9ae -r 331d698e1118 wxPopen.py --- a/wxPopen.py Mon Jul 20 16:28:56 2009 +0200 +++ b/wxPopen.py Tue Jul 28 17:43:19 2009 +0200 @@ -131,7 +131,7 @@ def log_the_end(self,ecode,pid): self.logger.write(self.Command_str + "\n") - self.logger.write_warning("exited with status %s (pid %s)\n"%(str(ecode),str(pid))) + self.logger.write_warning(_("exited with status %s (pid %s)\n")%(str(ecode),str(pid))) def finish(self, pid,ecode): self.finished = True