add i18n for some strings in DiscoveryDialog, DurationEditDialog, ProjectDialog and CodeFileEditor
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Thu, 21 Apr 2016 17:49:39 +0300
changeset 1495 078047c3ab85
parent 1494 00910a8572d9
child 1496 ac8a90b278f1
add i18n for some strings in DiscoveryDialog, DurationEditDialog, ProjectDialog and CodeFileEditor
dialogs/DiscoveryDialog.py
dialogs/DurationEditorDialog.py
dialogs/ProjectDialog.py
editors/CodeFileEditor.py
--- a/dialogs/DiscoveryDialog.py	Thu Apr 21 17:47:35 2016 +0300
+++ b/dialogs/DiscoveryDialog.py	Thu Apr 21 17:49:39 2016 +0300
@@ -78,7 +78,7 @@
         wx.Dialog.__init__(self, id=ID_DISCOVERYDIALOG, 
               name='DiscoveryDialog', parent=prnt,  
               size=wx.Size(600, 600), style=wx.DEFAULT_DIALOG_STYLE,
-              title='Service Discovery')
+              title=_('Service Discovery'))
         
         self.staticText1 = wx.StaticText(id=ID_DISCOVERYDIALOGSTATICTEXT1,
               label=_('Services available:'), name='staticText1', parent=self,
@@ -88,10 +88,10 @@
         self.ServicesList = AutoWidthListCtrl(id=ID_DISCOVERYDIALOGSERVICESLIST,
               name='ServicesList', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 0), 
               style=wx.LC_REPORT|wx.LC_EDIT_LABELS|wx.LC_SORT_ASCENDING|wx.LC_SINGLE_SEL)
-        self.ServicesList.InsertColumn(0, 'NAME')
-        self.ServicesList.InsertColumn(1, 'TYPE')
-        self.ServicesList.InsertColumn(2, 'IP')
-        self.ServicesList.InsertColumn(3, 'PORT')
+        self.ServicesList.InsertColumn(0, _('NAME'))
+        self.ServicesList.InsertColumn(1, _('TYPE'))
+        self.ServicesList.InsertColumn(2, _('IP'))
+        self.ServicesList.InsertColumn(3, _('PORT'))
         self.ServicesList.SetColumnWidth(0, 150)
         self.ServicesList.SetColumnWidth(1, 150)
         self.ServicesList.SetColumnWidth(2, 150)
--- a/dialogs/DurationEditorDialog.py	Thu Apr 21 17:47:35 2016 +0300
+++ b/dialogs/DurationEditorDialog.py	Thu Apr 21 17:49:39 2016 +0300
@@ -148,9 +148,9 @@
     
     def OnOK(self, event):
         errors = []
-        for control, name in [(self.Days, "days"), (self.Hours, "hours"), 
-                              (self.Minutes, "minutes"), (self.Seconds, "seconds"),
-                              (self.Milliseconds, "milliseconds")]:
+        for control, name in [(self.Days, _("days")), (self.Hours, _("hours")), 
+                              (self.Minutes, _("minutes")), (self.Seconds, _("seconds")),
+                              (self.Milliseconds, _("milliseconds"))]:
             try:
                 value = float(control.GetValue())
             except ValueError, e:
--- a/dialogs/ProjectDialog.py	Thu Apr 21 17:47:35 2016 +0300
+++ b/dialogs/ProjectDialog.py	Thu Apr 21 17:49:39 2016 +0300
@@ -51,10 +51,10 @@
     def OnOK(self, event):
         values = self.ProjectProperties.GetValues()
         error = []
-        for param, name in [("projectName", "Project Name"),
-                            ("productName", "Product Name"),
-                            ("productVersion", "Product Version"),
-                            ("companyName", "Company Name")]:
+        for param, name in [("projectName", _("Project Name")),
+                            ("productName", _("Product Name")),
+                            ("productVersion", _("Product Version")),
+                            ("companyName", _("Company Name"))]:
             if values[param] == "":
                 error.append(name)
         if len(error) > 0:
@@ -63,7 +63,7 @@
                 if i == 0:
                     text += item
                 elif i == len(error) - 1:
-                    text += " and %s"%item
+                    text += _(" and %s")%item
                 else:
                     text += ", %s"%item
             dialog = wx.MessageDialog(self, 
--- a/editors/CodeFileEditor.py	Thu Apr 21 17:47:35 2016 +0300
+++ b/editors/CodeFileEditor.py	Thu Apr 21 17:49:39 2016 +0300
@@ -660,11 +660,13 @@
 
         self.VariablesDefaultValue = {"Name" : "", "Type" : DefaultType, "Initial": "",
                                       "Description":"", "OnChange":"", "Options":""}
-        self.Table = VariablesTable(self, [], ["#", "Name", "Type", "Initial",
-                                    "Description", "OnChange", "Options"])
+        self.Table = VariablesTable(self, [], ["#", "Name","Type", "Initial",
+                                               "Description", "OnChange", "Options"])        
+        # self.Table = VariablesTable(self, [], [_("#"), _("Name"), _("Type"), _("Initial"),
+        #                                        _("Description"), _("OnChange"), _("Options")])
         self.ColAlignements = [wx.ALIGN_RIGHT] +  \
                               [wx.ALIGN_LEFT]*(len(self.VariablesDefaultValue))
-        self.ColSizes = [20, 150] + [100]*(len(self.VariablesDefaultValue)-1)
+        self.ColSizes = [20, 150] + [130]*(len(self.VariablesDefaultValue)-1)
         self.VariablesGrid.SetTable(self.Table)
         self.VariablesGrid.SetButtons({"Add": self.AddVariableButton,
                                        "Delete": self.DeleteVariableButton,