add l18n support to variable table in CodeFileEditor (python/C extension)
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Thu, 22 Jun 2017 16:07:56 +0300
changeset 1704 794a47ef5323
parent 1703 ba0dde7f047a
child 1705 5df7b3d404e8
add l18n support to variable table in CodeFileEditor (python/C extension)
editors/CodeFileEditor.py
--- a/editors/CodeFileEditor.py	Thu Jun 22 16:06:34 2017 +0300
+++ b/editors/CodeFileEditor.py	Thu Jun 22 16:07:56 2017 +0300
@@ -678,10 +678,7 @@
 
         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, [], self.GetVariableTableColnames())
         self.ColAlignements = [wx.ALIGN_RIGHT] +  \
                               [wx.ALIGN_LEFT]*(len(self.VariablesDefaultValue))
         self.ColSizes = [20, 150] + [130]*(len(self.VariablesDefaultValue)-1)
@@ -737,6 +734,10 @@
             self.VariablesGrid.SetColSize(col, self.ColSizes[col])
         self.Table.ResetView(self.VariablesGrid)
 
+    def GetVariableTableColnames(self):
+        _ = lambda x : x
+    	return ["#", _("Name"),_("Type"), _("Initial"), _("Description"), _("OnChange"), _("Options")]
+
     def RefreshModel(self):
         self.Controler.SetVariables(self.Table.GetData())
         self.RefreshBuffer()