diff --git a/invesalius/gui/data_notebook.py b/invesalius/gui/data_notebook.py index 5a50548..82dcd2e 100644 --- a/invesalius/gui/data_notebook.py +++ b/invesalius/gui/data_notebook.py @@ -39,10 +39,10 @@ class NotebookPanel(wx.Panel): if sys.platform != 'win32': book.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) - book.AddPage(MasksListCtrlPanel(book), "Masks") - book.AddPage(SurfacesListCtrlPanel(book), "Surfaces") - book.AddPage(MeasuresListCtrlPanel(book), "Measures") - book.AddPage(AnnotationsListCtrlPanel(book), "Annotations") + book.AddPage(MasksListCtrlPanel(book), _("Masks")) + book.AddPage(SurfacesListCtrlPanel(book), _("Surfaces")) + book.AddPage(MeasuresListCtrlPanel(book), _("Measures")) + book.AddPage(AnnotationsListCtrlPanel(book), _("Annotations")) book.SetSelection(0) @@ -102,8 +102,8 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): def __init_columns(self): self.InsertColumn(0, "", wx.LIST_FORMAT_CENTER) - self.InsertColumn(1, "Name") - self.InsertColumn(2, "Threshold", wx.LIST_FORMAT_RIGHT) + self.InsertColumn(1, _("Name")) + self.InsertColumn(2, _("Threshold"), wx.LIST_FORMAT_RIGHT) self.SetColumnWidth(0, 20) self.SetColumnWidth(1, 120) @@ -161,7 +161,7 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): wx_image.SetData(new_image.tostring()) return wx.BitmapFromImage(wx_image.Scale(16, 16)) - def InsertNewItem(self, index=0, label="Mask 1", threshold="(1000, 4500)", + def InsertNewItem(self, index=0, label=_("Mask 1"), threshold="(1000, 4500)", colour=None): self.InsertStringItem(index, "") self.SetStringItem(index, 1, label, @@ -231,9 +231,9 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): def __init_columns(self): self.InsertColumn(0, "", wx.LIST_FORMAT_CENTER) - self.InsertColumn(1, "Name") - self.InsertColumn(2, "Volume (mm3)") - self.InsertColumn(3, "Transparency", wx.LIST_FORMAT_RIGHT) + self.InsertColumn(1, _("Name")) + self.InsertColumn(2, _("Volume (mm3)")) + self.InsertColumn(3, _("Transparency"), wx.LIST_FORMAT_RIGHT) self.SetColumnWidth(0, 20) self.SetColumnWidth(1, 85) @@ -435,9 +435,9 @@ class AnnotationsListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): def __init_columns(self): self.InsertColumn(0, "", wx.LIST_FORMAT_CENTER) - self.InsertColumn(1, "Name") - self.InsertColumn(2, "Type", wx.LIST_FORMAT_CENTER) - self.InsertColumn(3, "Value") + self.InsertColumn(1, _("Name")) + self.InsertColumn(2, _("Type"), wx.LIST_FORMAT_CENTER) + self.InsertColumn(3, _("Value")) self.SetColumnWidth(0, 20) self.SetColumnWidth(1, 90) diff --git a/invesalius/gui/default_tasks.py b/invesalius/gui/default_tasks.py index 4486824..cb262b2 100755 --- a/invesalius/gui/default_tasks.py +++ b/invesalius/gui/default_tasks.py @@ -166,7 +166,7 @@ class UpperTaskPanel(wx.Panel): # Fold 1 - Import - item = fold_panel.AddFoldPanel("1. InVesalius start", collapsed=True, + item = fold_panel.AddFoldPanel(_("1. InVesalius start"), collapsed=True, foldIcons=image_list) style = fold_panel.GetCaptionStyle(item) col = style.GetFirstColour() @@ -179,7 +179,7 @@ class UpperTaskPanel(wx.Panel): # Fold 2 - Mask for segmentation and edition - item = fold_panel.AddFoldPanel("2. Select region of interest", + item = fold_panel.AddFoldPanel(_("2. Select region of interest"), collapsed=True, foldIcons=image_list) style = fold_panel.GetCaptionStyle(item) col = style.GetFirstColour() @@ -196,7 +196,7 @@ class UpperTaskPanel(wx.Panel): # apply button # Contour - slider # enable / disable Fill holes - item = fold_panel.AddFoldPanel("3. Configure 3D surface", collapsed=True, + item = fold_panel.AddFoldPanel(_("3. Configure 3D surface"), collapsed=True, foldIcons=image_list) style = fold_panel.GetCaptionStyle(item) col = style.GetFirstColour() @@ -207,7 +207,7 @@ class UpperTaskPanel(wx.Panel): # Fold 4 # Export volume - item = fold_panel.AddFoldPanel("4. Export data", collapsed=True, + item = fold_panel.AddFoldPanel(_("4. Export data"), collapsed=True, foldIcons=image_list) style = fold_panel.GetCaptionStyle(item) col = style.GetFirstColour() diff --git a/invesalius/gui/default_viewers.py b/invesalius/gui/default_viewers.py index f11c930..6994fa1 100755 --- a/invesalius/gui/default_viewers.py +++ b/invesalius/gui/default_viewers.py @@ -76,23 +76,23 @@ class Panel(wx.Panel): p1 = slice_viewer.Viewer(self, "AXIAL") s1 = wx.aui.AuiPaneInfo().Centre().Row(0).\ - Name("Axial Slice").Caption("Axial slice").\ + Name("Axial Slice").Caption(_("Axial slice")).\ MaximizeButton(True).CloseButton(False) p2 = slice_viewer.Viewer(self, "CORONAL") s2 = wx.aui.AuiPaneInfo().Centre().Row(0).\ - Name("Coronal Slice").Caption("Coronal slice").\ + Name("Coronal Slice").Caption(_("Coronal slice")).\ MaximizeButton(True).CloseButton(False) p3 = slice_viewer.Viewer(self, "SAGITAL") s3 = wx.aui.AuiPaneInfo().Centre().Row(1).\ - Name("Sagital Slice").Caption("Sagital slice").\ + Name("Sagital Slice").Caption(_("Sagital slice")).\ MaximizeButton(True).CloseButton(False) p4 = VolumeViewerCover(self) #p4 = volume_viewer.Viewer(self) s4 = wx.aui.AuiPaneInfo().Row(1).Name("Volume").\ - Bottom().Centre().Caption("Volume").\ + Bottom().Centre().Caption(_("Volume")).\ MaximizeButton(True).CloseButton(False) self.s4 = s4 @@ -165,25 +165,25 @@ class Panel(wx.Panel): p1 = slice_viewer.Viewer(self, "AXIAL") aui_manager.AddPane(p1, wx.aui.AuiPaneInfo(). - Name("Axial Slice").Caption("Axial slice"). + Name("Axial Slice").Caption(_("Axial slice")). MaximizeButton(True).CloseButton(False)) p2 = slice_viewer.Viewer(self, "CORONAL") aui_manager.AddPane(p2, wx.aui.AuiPaneInfo(). - Name("Coronal Slice").Caption("Coronal slice"). + Name("Coronal Slice").Caption(_("Coronal slice")). MaximizeButton(True).CloseButton(False)) p3 = slice_viewer.Viewer(self, "SAGITAL") aui_manager.AddPane(p3, wx.aui.AuiPaneInfo(). - Name("Sagittal Slice").Caption("Sagittal slice"). + Name("Sagittal Slice").Caption(_("Sagittal slice")). MaximizeButton(True).CloseButton(False)) #p4 = volume_viewer.Viewer(self) aui_manager.AddPane(VolumeViewerCover, wx.aui.AuiPaneInfo(). - Name("Volume").Caption("Volume"). + Name("Volume").Caption(_("Volume")). MaximizeButton(True).CloseButton(False)) splitter.AppendWindow(p1) @@ -406,7 +406,7 @@ class VolumeToolPanel(wx.Panel): self.button_slice_plane.PopupMenu(self.slice_plane_menu) def OnSavePreset(self, evt): - d = wx.TextEntryDialog(self, "Preset name") + d = wx.TextEntryDialog(self, _("Preset name")) if d.ShowModal() == wx.ID_OK: preset_name = d.GetValue() ps.Publisher().sendMessage('Save raycasting preset', @@ -434,7 +434,7 @@ class VolumeToolPanel(wx.Panel): ID_TO_TOOL_ITEM[id] = item TOOL_STATE[id] = False self.submenu_raycasting_tools = submenu - menu.AppendMenu(RAYCASTING_TOOLS, "Tools", submenu) + menu.AppendMenu(RAYCASTING_TOOLS, _("Tools"), submenu) menu.Enable(RAYCASTING_TOOLS, 0) self.menu_raycasting = menu diff --git a/invesalius/gui/dialogs.py b/invesalius/gui/dialogs.py index b0c3578..81366a4 100644 --- a/invesalius/gui/dialogs.py +++ b/invesalius/gui/dialogs.py @@ -48,11 +48,11 @@ class NumberDialog(wx.Dialog): # Buttons btn_ok = wx.Button(self, wx.ID_OK) - btn_ok.SetHelpText("Above value will be applied.") + btn_ok.SetHelpText(_("Above value will be applied.")) btn_ok.SetDefault() btn_cancel = wx.Button(self, wx.ID_CANCEL) - btn_cancel.SetHelpText("Value will not be applied.") + btn_cancel.SetHelpText(_("Value will not be applied.")) btnsizer = wx.StdDialogButtonSizer() btnsizer.AddButton(btn_ok) @@ -90,7 +90,7 @@ def ShowNumberDialog(message, value=0): class ProgressDialog(object): def __init__(self, maximum): self.title = "InVesalius 3" - self.msg = "Loading DICOM files" + self.msg = _("Loading DICOM files") self.maximum = maximum self.current = 0 self.style = wx.PD_CAN_ABORT | wx.PD_APP_MODAL @@ -138,7 +138,7 @@ WILDCARD_OPEN = "InVesalius 3 project (*.inv3)|*.inv3|"\ def ShowOpenProjectDialog(): # Default system path current_dir = os.path.abspath(".") - dlg = wx.FileDialog(None, message="Open InVesalius 3 project...", + dlg = wx.FileDialog(None, message=_("Open InVesalius 3 project..."), defaultDir="", defaultFile="", wildcard=WILDCARD_OPEN, style=wx.OPEN|wx.CHANGE_DIR) @@ -161,7 +161,7 @@ def ShowOpenProjectDialog(): def ShowImportDirDialog(): current_dir = os.path.abspath(".") - dlg = wx.DirDialog(None, "Choose a DICOM folder:", "", + dlg = wx.DirDialog(None, _("Choose a DICOM folder:"), "", style=wx.DD_DEFAULT_STYLE | wx.DD_DIR_MUST_EXIST | wx.DD_CHANGE_DIR) @@ -183,10 +183,10 @@ def ShowImportDirDialog(): def ShowSaveAsProjectDialog(default_filename=None): current_dir = os.path.abspath(".") dlg = wx.FileDialog(None, - "Save project as...", # title + _("Save project as..."), # title "", # last used directory default_filename, - "InVesalius project (*.inv3)|*.inv3", + _("InVesalius project (*.inv3)|*.inv3"), wx.SAVE|wx.OVERWRITE_PROMPT) #dlg.SetFilterIndex(0) # default is VTI @@ -249,7 +249,7 @@ class MessageDialog(wx.Dialog): self.Centre() def SaveChangesDialog__Old(filename): - message = "Save changes to %s?"%filename + message = _("Save changes to %s?")%filename dlg = MessageDialog(message) answer = dlg.ShowModal() @@ -276,7 +276,7 @@ def ImportEmptyDirectory(dirpath): dlg.Destroy() def ImportInvalidFiles(): - msg = "There are no DICOM files on the selected directory." + msg = _("There are no DICOM files on the selected directory.") if sys.platform == 'darwin': dlg = wx.MessageDialog(None, "", msg, wx.ICON_INFORMATION | wx.OK) @@ -288,7 +288,7 @@ def ImportInvalidFiles(): def SaveChangesDialog(filename): current_dir = os.path.abspath(".") - msg = "Save changes to %s?"%filename + msg = _("Save changes to %s?")%filename if sys.platform == 'darwin': dlg = wx.MessageDialog(None, "", msg, wx.ICON_QUESTION | wx.YES_NO | wx.CANCEL) @@ -310,7 +310,7 @@ def SaveChangesDialog(filename): def SaveChangesDialog2(filename): current_dir = os.path.abspath(".") - msg = "Save changes to %s?"%filename + msg = _("Save changes to %s?")%filename if sys.platform == 'darwin': dlg = wx.MessageDialog(None, "", msg, wx.ICON_QUESTION | wx.YES_NO) @@ -334,16 +334,16 @@ def ShowAboutDialog(parent): info = wx.AboutDialogInfo() info.Name = "InVesalius" info.Version = "3.a.1 - RP" - info.Copyright = "(C) 2007 Renato Archer Research Centre" + info.Copyright = _("(C) 2007 Renato Archer Research Centre") info.Description = wordwrap( - "InVesalius is a software for medical imaging 3D reconstruction. "+\ - "Its input is a sequency of DICOM 2D image files acquired with CT or MR.\n\n"+\ - "The software also allows generating correspondent STL files,"+\ - "so the user can print 3D physical models of the patient's anatomy "+\ - "using Rapid Prototyping.", 350, wx.ClientDC(parent)) + _("InVesalius is a software for medical imaging 3D reconstruction. ")+\ + _("Its input is a sequency of DICOM 2D image files acquired with CT or MR.\n\n")+\ + _("The software also allows generating correspondent STL files,")+\ + _("so the user can print 3D physical models of the patient's anatomy ")+\ + _("using Rapid Prototyping."), 350, wx.ClientDC(parent)) info.WebSite = ("http://www.softwarepublico.gov.br/", "InVesalius Community") - info.License = "GNU GPL (General Public License) version 2" + info.License = _("GNU GPL (General Public License) version 2") #info.Translators = "" #info.Artists = @@ -358,7 +358,7 @@ def ShowAboutDialog(parent): def ShowSavePresetDialog(default_filename="raycasting"): dlg = wx.TextEntryDialog(None, - "Save raycasting preset as:", + _("Save raycasting preset as:"), "InVesalius 3") #dlg.SetFilterIndex(0) # default is VTI filename = None diff --git a/invesalius/gui/dicom_preview_panel.py b/invesalius/gui/dicom_preview_panel.py index 6799ed1..b401f8d 100755 --- a/invesalius/gui/dicom_preview_panel.py +++ b/invesalius/gui/dicom_preview_panel.py @@ -39,11 +39,11 @@ NCOLS = 6 MAX_VALUE = NCOLS*NROWS -STR_SIZE = "Image size: %d x %d" -STR_SPC = "Spacing: %.2f" -STR_LOCAL = "Location: %.2f" +STR_SIZE = _("Image size: %d x %d") +STR_SPC = _("Spacing: %.2f") +STR_LOCAL = _("Location: %.2f") STR_PATIENT = "%s\n%s" -STR_ACQ = "%s %s\nMade in InVesalius" +STR_ACQ = _("%s %s\nMade in InVesalius") class SingleImagePreview(wx.Panel): def __init__(self, parent): @@ -63,7 +63,7 @@ class SingleImagePreview(wx.Panel): text_image_size = vtku.Text() text_image_size.SetPosition(const.TEXT_POS_LEFT_UP) - text_image_size.SetValue("image size") + text_image_size.SetValue(_("image size")) self.text_image_size = text_image_size text_image_location = vtku.Text() @@ -72,14 +72,14 @@ class SingleImagePreview(wx.Panel): text_image_location.SetValue("localization") self.text_image_location = text_image_location - value = "id\nprotocol" + value = _("id\nprotocol") text_patient = vtku.Text() text_patient.SetJustificationToRight() text_patient.SetPosition(const.TEXT_POS_RIGHT_UP) text_patient.SetValue(value) self.text_patient = text_patient - value = "date time\n Made in InVesalius" + value = _("date time\n Made in InVesalius") text_acquisition = vtku.Text() text_acquisition.SetJustificationToRight() text_acquisition.SetVerticalJustificationToBottom() @@ -125,7 +125,7 @@ class SingleImagePreview(wx.Panel): slider.SetTickFreq(1, 1) self.slider = slider - checkbox = wx.CheckBox(self, -1, "Auto-play") + checkbox = wx.CheckBox(self, -1, _("Auto-play")) self.checkbox = checkbox in_sizer = wx.BoxSizer(wx.HORIZONTAL) @@ -279,10 +279,10 @@ class Preview(wx.Panel): def _init_ui(self): - self.title = wx.StaticText(self, -1, "Image", + self.title = wx.StaticText(self, -1, _("Image"), style=wx.ALIGN_CENTER) - self.subtitle = wx.StaticText(self, -1, "Image", + self.subtitle = wx.StaticText(self, -1, _("Image"), style=wx.ALIGN_CENTER) self.image_viewer = wx.StaticBitmap(self, -1) @@ -615,7 +615,7 @@ class DicomPreviewSeries(wx.Panel): float(group.dicom.image.window), float(group.dicom.image.level), group.title, - "%d Images" %(group.nslices), + _("%d Images") %(group.nslices), n, group_list, group.dicom) @@ -736,7 +736,7 @@ class DicomPreview(wx.Panel): info = (dicom.image.imagedata, dicom.image.window, dicom.image.level, - "Image %d" % (dicom.image.number), + _("Image %d") % (dicom.image.number), "%.2f" % (dicom.image.position[2]), n, dicom) @@ -761,7 +761,7 @@ class DicomPreview(wx.Panel): info = (dicom.image, dicom.image.window, dicom.image.level, - "Image %d" % (dicom.image.number), + _("Image %d") % (dicom.image.number), "%.2f" % (dicom.image.position[2]), n, dicom) diff --git a/invesalius/gui/frame.py b/invesalius/gui/frame.py index 68fe19c..9976d43 100755 --- a/invesalius/gui/frame.py +++ b/invesalius/gui/frame.py @@ -80,8 +80,8 @@ class Frame(wx.Frame): def __bind_events(self): ps.Publisher().subscribe(self.ShowContentPanel, 'Show content panel') - ps.Publisher().subscribe(self.ShowImportPanel, "Show import panel in frame") - ps.Publisher().subscribe(self.UpdateAui, "Update AUI") + ps.Publisher().subscribe(self.ShowImportPanel, 'Show import panel in frame') + ps.Publisher().subscribe(self.UpdateAui, 'Update AUI') ps.Publisher().subscribe(self.ShowTask, 'Show task panel') ps.Publisher().subscribe(self.HideTask, 'Hide task panel') ps.Publisher().subscribe(self.SetProjectName, 'Set project name') @@ -135,7 +135,7 @@ class Frame(wx.Frame): aui_manager.AddPane(viewers.Panel(self), wx.aui.AuiPaneInfo(). - Caption("Data panel").CaptionVisible(False). + Caption(_("Data panel")).CaptionVisible(False). Centre().CloseButton(False).Floatable(False). Hide().Layer(1).MaximizeButton(True).Name("Data"). Position(1)) @@ -144,7 +144,7 @@ class Frame(wx.Frame): aui_manager.AddPane(imp.Panel(self), wx.aui.AuiPaneInfo(). Name("Import").Centre().Hide(). MaximizeButton(True).Floatable(True). - Caption("Preview medical data to be reconstructed"). + Caption(_("Preview medical data to be reconstructed")). CaptionVisible(True)) @@ -303,11 +303,11 @@ class MenuBar(wx.MenuBar): # FILE file_menu = wx.Menu() #file_menu.Append(const.ID_DICOM_LOAD_NET, "Import DICOM from Internet...") - file_menu.Append(const.ID_DICOM_IMPORT, "Import DICOM...\tCtrl+I") - file_menu.Append(const.ID_PROJECT_OPEN, "Open Project...\tCtrl+O") - file_menu.Append(const.ID_PROJECT_SAVE, "Save Project\tCtrl+S") - file_menu.Append(const.ID_PROJECT_SAVE_AS, "Save Project As...") - file_menu.Append(const.ID_PROJECT_CLOSE, "Close Project") + file_menu.Append(const.ID_DICOM_IMPORT, _("Import DICOM...\tCtrl+I")) + file_menu.Append(const.ID_PROJECT_OPEN, _("Open Project...\tCtrl+O")) + file_menu.Append(const.ID_PROJECT_SAVE, _("Save Project\tCtrl+S")) + file_menu.Append(const.ID_PROJECT_SAVE_AS, _("Save Project As...")) + file_menu.Append(const.ID_PROJECT_CLOSE, _("Close Project")) file_menu.AppendSeparator() #file_menu.Append(const.ID_PROJECT_INFO, "Project Information...") #file_menu.AppendSeparator() @@ -316,7 +316,7 @@ class MenuBar(wx.MenuBar): #file_menu.AppendSeparator() #file_menu.Append(1, "C:\InvData\sample.inv") #file_menu.AppendSeparator() - file_menu.Append(const.ID_EXIT, "Exit") + file_menu.Append(const.ID_EXIT, _("Exit")) # EDIT #file_edit = wx.Menu() @@ -355,10 +355,10 @@ class MenuBar(wx.MenuBar): # HELP help_menu = wx.Menu() - help_menu.Append(105, "Getting Started...") + help_menu.Append(105, _("Getting Started...")) #help_menu.Append(108, "User Manual...") help_menu.AppendSeparator() - help_menu.Append(const.ID_ABOUT, "About...") + help_menu.Append(const.ID_ABOUT, _("About...")) #help_menu.Append(107, "Check For Updates Now...") # TODO: Check what is necessary under MacOS to show Groo and not Python @@ -369,12 +369,12 @@ class MenuBar(wx.MenuBar): #test_item = test_menu.Append(-1, '&About Groo', 'Groo RULES!!!') #wx.App.SetMacAboutMenuItemId(test_item.GetId()) - self.Append(file_menu, "File") + self.Append(file_menu, _("File")) #self.Append(file_edit, "Edit") #self.Append(view_menu, "View") #self.Append(tools_menu, "Tools") #self.Append(options_menu, "Options") - self.Append(help_menu, "Help") + self.Append(help_menu, _("Help")) def __bind_events(self): # TODO: in future, possibly when wxPython 2.9 is available, @@ -417,7 +417,7 @@ class StatusBar(wx.StatusBar): wx.StatusBar.__init__(self, parent, -1) self.SetFieldsCount(3) self.SetStatusWidths([-2,-2,-1]) - self.SetStatusText("Ready", 0) + self.SetStatusText(_("Ready"), 0) self.SetStatusText("", 1) self.SetStatusText("", 2) @@ -525,13 +525,13 @@ class ProjectToolBar(wx.ToolBar): # "Load medical image...", # BMP_NET) self.AddLabelTool(const.ID_DICOM_IMPORT, - "Import medical image...", + _("Import medical image..."), BMP_IMPORT) self.AddLabelTool(const.ID_PROJECT_OPEN, - "Open InVesalius 3 project...", + _("Open InVesalius 3 project..."), BMP_OPEN) self.AddLabelTool(const.ID_PROJECT_SAVE, - "Save InVesalius project", + _("Save InVesalius project"), BMP_SAVE) #self.AddLabelTool(const.ID_SAVE_SCREENSHOT, # "Take photo of screen", @@ -626,25 +626,25 @@ class ObjectToolBar(wx.ToolBar): wx.BITMAP_TYPE_PNG) self.AddLabelTool(const.STATE_ZOOM, - "Zoom", + _("Zoom"), BMP_ZOOM, kind = wx.ITEM_CHECK) self.AddLabelTool(const.STATE_ZOOM_SL, - "Zoom based on selection", + _("Zoom based on selection"), BMP_ZOOM_SELECT, kind = wx.ITEM_CHECK) self.AddLabelTool(const.STATE_SPIN, - "Rotate", BMP_ROTATE, + _("Rotate"), BMP_ROTATE, kind = wx.ITEM_CHECK) self.AddLabelTool(const.STATE_PAN, - "Move", BMP_MOVE, + _("Move"), BMP_MOVE, kind = wx.ITEM_CHECK) self.AddLabelTool(const.STATE_WL, - "Window and Level", BMP_CONTRAST, + _("Window and Level"), BMP_CONTRAST, kind = wx.ITEM_CHECK) self.Realize() diff --git a/invesalius/gui/import_data_wizard.py b/invesalius/gui/import_data_wizard.py index 5c0d924..b3bb686 100644 --- a/invesalius/gui/import_data_wizard.py +++ b/invesalius/gui/import_data_wizard.py @@ -184,8 +184,8 @@ class DirPage(BasePage): def __init_specific_gui(self): - line1 = wx.StaticText(self, -1,"Select the directory which "+\ - "contains medical images of the study interest.") + line1 = wx.StaticText(self, -1,_("Select the directory which ")+\ + _("contains medical images of the study interest.")) @@ -229,14 +229,14 @@ class DirPage(BasePage): style.SetSecondColour(wx.Colour(255,255,255)) # Fold 1 - Surface properties - item = fold_panel.AddFoldPanel("Advanced options", + item = fold_panel.AddFoldPanel(_("Advanced options"), collapsed=True) fold_panel.ApplyCaptionStyle(item, style) fold_panel.AddFoldPanelWindow(item, - wx.CheckBox(item, wx.ID_ANY, "Use selected folder(s) as default"), + wx.CheckBox(item, wx.ID_ANY, _("Use selected folder(s) as default")), Spacing= 0, leftSpacing=0, rightSpacing=0) fold_panel.AddFoldPanelWindow(item, - wx.CheckBox(item, wx.ID_ANY, "Enable recursion in folder(s)"), + wx.CheckBox(item, wx.ID_ANY, _("Enable recursion in folder(s)")), Spacing= 0, leftSpacing=0, rightSpacing=0) @@ -252,18 +252,18 @@ class DirPage(BasePage): self.next.GetNext().DecreasePageNumber() def OnAddDir(self, evt): - dlg = wx.DirDialog(self, "Choose a directory:", + dlg = wx.DirDialog(self, _("Choose a directory:"), style=wx.DD_DIR_MUST_EXIST) if dlg.ShowModal() == wx.ID_OK: path = dlg.GetPath() self.selected_dir.append(path) - self.link_add_new.SetLabel("Add another directory") + self.link_add_new.SetLabel(_("Add another directory")) self.AddNewDir(path) dlg.Destroy() def OnChangeDir(self, prev_dir, text): - dlg = wx.DirDialog(self, "Choose a directory:", + dlg = wx.DirDialog(self, _("Choose a directory:"), style=wx.DD_DIR_MUST_EXIST) dlg.SetPath(prev_dir) @@ -282,8 +282,8 @@ class DirPage(BasePage): text_dir_path = wx.StaticText(self, -1, path) - tooltip = wx.ToolTip("Remove this directory from list") - link_remove = hl.HyperLinkCtrl(self, -1,"Remove") + tooltip = wx.ToolTip(_("Remove this directory from list")) + link_remove = hl.HyperLinkCtrl(self, -1,_("Remove")) link_remove.SetUnderlines(True, False, False) link_remove.SetColours("BLUE", "BLUE", "BLUE") link_remove.SetToolTip(tooltip) @@ -308,7 +308,7 @@ class DirPage(BasePage): self.line3.Hide(sizer) self.line3.RemoveSizer(sizer) if not self.selected_dir: - self.link_add_new.SetLabel("Add another directory") + self.link_add_new.SetLabel(_("Add another directory")) self.Layout() self.Fit() @@ -337,15 +337,15 @@ class DirPage(BasePage): self.log.write('DirBrowseButton: %s\n' % evt.GetString()) def CreateWizard(parent): - wizard = wiz.Wizard(parent, -1, "Import medical images", getWizTest1Bitmap()) + wizard = wiz.Wizard(parent, -1, _("Import medical images"), getWizTest1Bitmap()) - page1 = DirPage(wizard, "Choose directory", 1) - page2 = RawDataPage(wizard, "Define RAW data", 2) - page3 = StudyPage(wizard, "Select study", 3) # 2 can be 3 + page1 = DirPage(wizard, _("Choose directory"), 1) + page2 = RawDataPage(wizard, _("Define RAW data"), 2) + page3 = StudyPage(wizard, _("Select study"), 3) # 2 can be 3 wizard.FitToPage(page1) - page3.sizer.Add(wx.StaticText(page3, -1, "\nThis is the last page.")) + page3.sizer.Add(wx.StaticText(page3, -1, _("\nThis is the last page."))) # Set the initial order of the pages page1.SetNext(page2) diff --git a/invesalius/gui/import_panel.py b/invesalius/gui/import_panel.py index 9fed249..16bbcd8 100644 --- a/invesalius/gui/import_panel.py +++ b/invesalius/gui/import_panel.py @@ -51,7 +51,7 @@ class InnerPanel(wx.Panel): self.splitter = splitter panel = wx.Panel(self) - button = wx.Button(panel, -1, "Import medical images", (20, 20)) + button = wx.Button(panel, -1, _("Import medical images"), (20, 20)) inner_sizer = wx.BoxSizer() inner_sizer.Add(button, 0, wx.ALIGN_CENTER_HORIZONTAL, 40) @@ -106,18 +106,18 @@ class TextPanel(wx.Panel): ) - tree.AddColumn("Patient name") - tree.AddColumn("Patient ID") - tree.AddColumn("Age") - tree.AddColumn("Gender") - tree.AddColumn("Study description") - tree.AddColumn("Modality") - tree.AddColumn("Date acquired") - tree.AddColumn("# Images") - tree.AddColumn("Institution") - tree.AddColumn("Date of birth") - tree.AddColumn("Accession Number") - tree.AddColumn("Referring physician") + tree.AddColumn(_("Patient name")) + tree.AddColumn(_("Patient ID")) + tree.AddColumn(_("Age")) + tree.AddColumn(_("Gender")) + tree.AddColumn(_("Study description")) + tree.AddColumn(_("Modality")) + tree.AddColumn(_("Date acquired")) + tree.AddColumn(_("# Images")) + tree.AddColumn(_("Institution")) + tree.AddColumn(_("Date of birth")) + tree.AddColumn(_("Accession Number")) + tree.AddColumn(_("Referring physician")) tree.SetMainColumn(0) # the one with the tree in it... tree.SetColumnWidth(0, 280) # Patient name @@ -133,7 +133,7 @@ class TextPanel(wx.Panel): tree.SetColumnWidth(10, 140) # Accession Number tree.SetColumnWidth(11, 160) # Referring physician - self.root = tree.AddRoot("InVesalius Database") + self.root = tree.AddRoot(_("InVesalius Database")) self.tree = tree def SelectSeries(self, pubsub_evt): @@ -293,8 +293,7 @@ class SeriesPanel(wx.Panel): self.dicom_preview.Show(0) self.serie_preview.Show(1) - - + self.serie_preview.SetPatientGroups(patient) self.dicom_preview.SetPatientGroups(patient) diff --git a/invesalius/gui/task_exporter.py b/invesalius/gui/task_exporter.py index 8bdf374..396a446 100644 --- a/invesalius/gui/task_exporter.py +++ b/invesalius/gui/task_exporter.py @@ -98,9 +98,9 @@ class InnerTaskPanel(wx.Panel): # Counter for projects loaded in current GUI # Fixed hyperlink items - tooltip = wx.ToolTip("Export InVesalius screen to a image file") + tooltip = wx.ToolTip(_("Export InVesalius screen to a image file")) link_export_picture = hl.HyperLinkCtrl(self, -1, - "Export picture...") + _("Export picture...")) link_export_picture.SetUnderlines(False, False, False) link_export_picture.SetColours("BLACK", "BLACK", "BLACK") link_export_picture.SetToolTip(tooltip) @@ -109,8 +109,8 @@ class InnerTaskPanel(wx.Panel): link_export_picture.Bind(hl.EVT_HYPERLINK_LEFT, self.OnLinkExportPicture) - tooltip = wx.ToolTip("Export 3D surface") - link_export_surface = hl.HyperLinkCtrl(self, -1,"Export 3D surface...") + tooltip = wx.ToolTip(_("Export 3D surface")) + link_export_surface = hl.HyperLinkCtrl(self, -1,_("Export 3D surface...")) link_export_surface.SetUnderlines(False, False, False) link_export_surface.SetColours("BLACK", "BLACK", "BLACK") link_export_surface.SetToolTip(tooltip) @@ -119,8 +119,8 @@ class InnerTaskPanel(wx.Panel): link_export_surface.Bind(hl.EVT_HYPERLINK_LEFT, self.OnLinkExportSurface) - tooltip = wx.ToolTip("Export 3D mask (voxels)") - link_export_mask = hl.HyperLinkCtrl(self, -1,"Export mask...") + tooltip = wx.ToolTip(_("Export 3D mask (voxels)")) + link_export_mask = hl.HyperLinkCtrl(self, -1,_("Export mask...")) link_export_mask.SetUnderlines(False, False, False) link_export_mask.SetColours("BLACK", "BLACK", "BLACK") link_export_mask.SetToolTip(tooltip) @@ -270,7 +270,7 @@ class InnerTaskPanel(wx.Panel): dlg = wx.FileDialog(None, - "Save 3D surface as...", # title + _("Save 3D surface as..."), # title "", # last used directory project_name, # filename WILDCARD_SAVE_3D, @@ -289,9 +289,9 @@ class InnerTaskPanel(wx.Panel): (filename, filetype)) else: dlg = wx.MessageDialog(None, - "You need to create a surface and make it "+ - "visible before exporting it.", - 'InVesalius Information', + _("You need to create a surface and make it ") + + _("visible before exporting it."), + _('InVesalius Information'), wx.OK | wx.ICON_INFORMATION) try: dlg.ShowModal() diff --git a/invesalius/gui/task_importer.py b/invesalius/gui/task_importer.py index c177af7..1b80bc3 100644 --- a/invesalius/gui/task_importer.py +++ b/invesalius/gui/task_importer.py @@ -61,8 +61,8 @@ class InnerTaskPanel(wx.Panel): self.float_hyper_list = [] # Fixed hyperlink items - tooltip = wx.ToolTip("Select DICOM or Analyze files to be reconstructed") - link_import_local = hl.HyperLinkCtrl(self, -1, "Import medical images...") + tooltip = wx.ToolTip(_("Select DICOM or Analyze files to be reconstructed")) + link_import_local = hl.HyperLinkCtrl(self, -1, _("Import medical images...")) link_import_local.SetUnderlines(False, False, False) link_import_local.SetColours("BLACK", "BLACK", "BLACK") link_import_local.SetToolTip(tooltip) @@ -79,8 +79,8 @@ class InnerTaskPanel(wx.Panel): #link_import_pacs.UpdateLink() #link_import_pacs.Bind(hl.EVT_HYPERLINK_LEFT, self.OnLinkImportPACS) - tooltip = wx.ToolTip("Open an existing InVesalius project...") - link_open_proj = hl.HyperLinkCtrl(self,-1,"Open an existing project...") + tooltip = wx.ToolTip(_("Open an existing InVesalius project...")) + link_open_proj = hl.HyperLinkCtrl(self,-1,_("Open an existing project...")) link_open_proj.SetUnderlines(False, False, False) link_open_proj.SetColours("BLACK", "BLACK", "BLACK") link_open_proj.SetToolTip(tooltip) diff --git a/invesalius/gui/task_slice.py b/invesalius/gui/task_slice.py index 4d4a6ee..05bfcb3 100644 --- a/invesalius/gui/task_slice.py +++ b/invesalius/gui/task_slice.py @@ -76,7 +76,7 @@ class InnerTaskPanel(wx.Panel): # Fixed hyperlink items - tooltip = wx.ToolTip("Create mask for slice segmentation and edition") + tooltip = wx.ToolTip(_("Create mask for slice segmentation and edition")) link_new_mask = hl.HyperLinkCtrl(self, -1, "Create new mask") link_new_mask.SetUnderlines(False, False, False) link_new_mask.SetColours("BLACK", "BLACK", "BLACK") @@ -105,7 +105,7 @@ class InnerTaskPanel(wx.Panel): self.fold_panel = fold_panel # Button to fold to select region task - button_next = wx.Button(self, -1, "Create 3D surface") + button_next = wx.Button(self, -1, _("Create 3D surface")) if sys.platform != 'win32': button_next.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) button_next.Bind(wx.EVT_BUTTON, self.OnButtonNextTask) @@ -134,8 +134,8 @@ class InnerTaskPanel(wx.Panel): self.GetMaskSelected()) def OnLinkNewMask(self, evt=None): - dlg = wx.TextEntryDialog(self, 'Name of new mask:', - 'InVesalius 3.0 - New mask') + dlg = wx.TextEntryDialog(self, _('Name of new mask:'), + _('InVesalius 3.0 - New mask')) dlg.CenterOnScreen() default_mask_name = const.MASK_NAME_PATTERN %(mask.Mask.general_index+2) dlg.SetValue(default_mask_name) @@ -193,7 +193,7 @@ class InnerFoldPanel(wx.Panel): style.SetSecondColour(default_colour) # Fold 1 - Mask properties - item = fold_panel.AddFoldPanel("Mask properties", collapsed=True) + item = fold_panel.AddFoldPanel(_("Mask properties"), collapsed=True) self.mask_prop_panel = MaskProperties(item) fold_panel.ApplyCaptionStyle(item, style) fold_panel.AddFoldPanelWindow(item, self.mask_prop_panel, Spacing= 0, @@ -201,7 +201,7 @@ class InnerFoldPanel(wx.Panel): fold_panel.Expand(fold_panel.GetFoldPanel(0)) # Fold 2 - Advanced edition tools - item = fold_panel.AddFoldPanel("Advanced edition tools", collapsed=True) + item = fold_panel.AddFoldPanel(_("Advanced edition tools"), collapsed=True) fold_panel.ApplyCaptionStyle(item, style) fold_panel.AddFoldPanelWindow(item, EditionTools(item), Spacing= 0, leftSpacing=0, rightSpacing=0) @@ -285,7 +285,7 @@ class MaskProperties(wx.Panel): ## LINE 2 text_thresh = wx.StaticText(self, -1, - "Set predefined or manual threshold:") + _("Set predefined or manual threshold:")) ## LINE 3 combo_thresh = wx.ComboBox(self, -1, "", size=(15,-1), @@ -437,17 +437,17 @@ class EditionTools(wx.Panel): self.SetBackgroundColour(default_colour) ## LINE 1 - text1 = wx.StaticText(self, -1, "Choose brush type, size or operation:") + text1 = wx.StaticText(self, -1, _("Choose brush type, size or operation:")) ## LINE 2 menu = wx.Menu() CIRCLE_BMP = wx.Bitmap("../icons/brush_circle.jpg", wx.BITMAP_TYPE_JPEG) - item = wx.MenuItem(menu, MENU_BRUSH_CIRCLE, "Circle") + item = wx.MenuItem(menu, MENU_BRUSH_CIRCLE, _("Circle")) item.SetBitmap(CIRCLE_BMP) SQUARE_BMP = wx.Bitmap("../icons/brush_square.jpg", wx.BITMAP_TYPE_JPEG) - item2 = wx.MenuItem(menu, MENU_BRUSH_SQUARE, "Square") + item2 = wx.MenuItem(menu, MENU_BRUSH_SQUARE, _("Square")) item2.SetBitmap(SQUARE_BMP) menu.AppendItem(item) @@ -483,7 +483,7 @@ class EditionTools(wx.Panel): line2.Add(combo_brush_op, 1, wx.EXPAND|wx.TOP|wx.RIGHT|wx.LEFT, 5) ## LINE 3 - text_thresh = wx.StaticText(self, -1, "Brush threshold range:") + text_thresh = wx.StaticText(self, -1, _("Brush threshold range:")) ## LINE 4 gradient_thresh = grad.GradientSlider(self, -1, 0, 5000, 0, 5000, diff --git a/invesalius/gui/task_surface.py b/invesalius/gui/task_surface.py index f484250..3b14a51 100644 --- a/invesalius/gui/task_surface.py +++ b/invesalius/gui/task_surface.py @@ -27,7 +27,7 @@ import wx.lib.pubsub as ps import gui.widgets.foldpanelbar as fpb #INTERPOLATION_MODE_LIST = ["Cubic", "Linear", "NearestNeighbor"] -QUALITY_LIST = ["Low", "Medium", "High", "Optimal *", "Custom"] +QUALITY_LIST = [_("Low"), _("Medium"), _("High"), _("Optimal *"), _("Custom")] SURFACE_LIST = [] MASK_LIST = ["Mask 1"] MIN_TRANSPARENCY = 0 @@ -38,7 +38,7 @@ BTN_NEW = wx.NewId() MENU_SQUARE = wx.NewId() MENU_CIRCLE = wx.NewId() -OP_LIST = ["Draw", "Erase", "Threshold"] +OP_LIST = [_("Draw"), _("Erase"), _("Threshold")] class TaskPanel(wx.Panel): @@ -80,7 +80,7 @@ class InnerTaskPanel(wx.Panel): self.Bind(wx.EVT_BUTTON, self.OnButton) # Fixed hyperlink items - tooltip = wx.ToolTip("Create 3D surface based on a mask") + tooltip = wx.ToolTip(_("Create 3D surface based on a mask")) link_new_surface = hl.HyperLinkCtrl(self, -1, "Create new 3D surface") link_new_surface.SetUnderlines(False, False, False) link_new_surface.SetColours("BLACK", "BLACK", "BLACK") @@ -99,7 +99,7 @@ class InnerTaskPanel(wx.Panel): fold_panel.SetBackgroundColour(default_colour) # Button to fold to select region task - button_next = wx.Button(self, -1, "Next step") + button_next = wx.Button(self, -1, _("Next step")) if sys.platform != 'win32': button_next.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) #button_next.Bind(wx.EVT_BUTTON, self.OnButtonNextTask) @@ -128,7 +128,7 @@ class InnerTaskPanel(wx.Panel): evt.Skip() def OnLinkNewSurface(self, evt=None): - dlg = NewSurfaceDialog(self, -1, 'InVesalius 3.0 - New surface') + dlg = NewSurfaceDialog(self, -1, _('InVesalius 3.0 - New surface')) if dlg.ShowModal() == wx.ID_OK: print "TODO: Send Signal - Create 3d surface %s \n" % dlg.GetValue() dlg.Destroy() @@ -165,7 +165,7 @@ class NewSurfaceDialog(wx.Dialog): # contents # Label related to mask name - label_mask = wx.StaticText(self, -1, "Select mask to be used for creating 3D surface:") + label_mask = wx.StaticText(self, -1, _("Select mask to be used for creating 3D surface:")) # Combo related to mask name combo_surface_name = wx.ComboBox(self, -1, "", choices= MASK_LIST, @@ -176,11 +176,11 @@ class NewSurfaceDialog(wx.Dialog): self.combo_surface_name = combo_surface_name - label_surface = wx.StaticText(self, -1, "Set new surface name:") + label_surface = wx.StaticText(self, -1, _("Set new surface name:")) text = wx.TextCtrl(self, -1, "", size=(80,-1)) - text.SetHelpText("Name the new surface to be created") - text.SetValue("Default 3D") + text.SetHelpText(_("Name the new surface to be created")) + text.SetValue(_("Default 3D")) self.text = text sizer = wx.BoxSizer(wx.VERTICAL) @@ -209,7 +209,7 @@ class NewSurfaceDialog(wx.Dialog): sizer.Fit(self) def GetValue(self): - return self.text.GetValue() +"| mask: "+ MASK_LIST[self.combo_surface_name.GetSelection()] + return self.text.GetValue() + _("| mask: ") + MASK_LIST[self.combo_surface_name.GetSelection()] class FoldPanel(wx.Panel): def __init__(self, parent): @@ -248,14 +248,14 @@ class InnerFoldPanel(wx.Panel): style.SetSecondColour(default_colour) # Fold 1 - Surface properties - item = fold_panel.AddFoldPanel("Surface properties", collapsed=True) + item = fold_panel.AddFoldPanel(_("Surface properties"), collapsed=True) fold_panel.ApplyCaptionStyle(item, style) fold_panel.AddFoldPanelWindow(item, SurfaceProperties(item), Spacing= 0, leftSpacing=0, rightSpacing=0) fold_panel.Expand(fold_panel.GetFoldPanel(0)) # Fold 2 - Surface quality - item = fold_panel.AddFoldPanel("Surface quality", collapsed=True) + item = fold_panel.AddFoldPanel(_("Surface quality"), collapsed=True) fold_panel.ApplyCaptionStyle(item, style) fold_panel.AddFoldPanelWindow(item, QualityAdjustment(item), Spacing= 0, leftSpacing=0, rightSpacing=0) @@ -300,7 +300,7 @@ class SurfaceProperties(wx.Panel): ## LINE 2 - text_transparency = wx.StaticText(self, -1, "Transparency:") + text_transparency = wx.StaticText(self, -1, _("Transparency:")) slider_transparency = wx.Slider(self, -1, 0, MIN_TRANSPARENCY, MAX_TRANSPARENCY, @@ -402,7 +402,7 @@ class QualityAdjustment(wx.Panel): # LINE 2 check_decimate = wx.CheckBox(self, -1, "") - text_decimate = wx.StaticText(self, -1, "Decimate resolution:") + text_decimate = wx.StaticText(self, -1, _("Decimate resolution:")) spin_decimate = wx.SpinCtrl(self, -1, "", (30, 50)) spin_decimate.SetRange(1,100) @@ -412,7 +412,7 @@ class QualityAdjustment(wx.Panel): # LINE 3 check_smooth = wx.CheckBox(self, -1, "") - text_smooth = wx.StaticText(self, -1, "Smooth iterations:") + text_smooth = wx.StaticText(self, -1, _("Smooth iterations:")) spin_smooth = wx.SpinCtrl(self, -1, "", (30, 50)) spin_smooth.SetRange(1,100) diff --git a/invesalius/gui/task_tools.py b/invesalius/gui/task_tools.py index 353496b..0234713 100644 --- a/invesalius/gui/task_tools.py +++ b/invesalius/gui/task_tools.py @@ -54,12 +54,12 @@ class InnerTaskPanel(wx.Panel): self.float_hyper_list = [] # Fixed text and hyperlink items - tooltip = wx.ToolTip("Measure distances") - txt_measure = wx.StaticText(self, -1, "Measure") + tooltip = wx.ToolTip(_("Measure distances")) + txt_measure = wx.StaticText(self, -1, _("Measure")) txt_measure.SetToolTip(tooltip) - tooltip = wx.ToolTip("Add text annotations") - txt_annotation = hl.HyperLinkCtrl(self, -1,"Add text annotations") + tooltip = wx.ToolTip(_("Add text annotations")) + txt_annotation = hl.HyperLinkCtrl(self, -1,_("Add text annotations")) txt_annotation.SetUnderlines(False, False, False) txt_annotation.SetColours("BLACK", "BLACK", "BLACK") txt_annotation.SetToolTip(tooltip) diff --git a/invesalius/gui/widgets/slice_menu.py b/invesalius/gui/widgets/slice_menu.py index 7df3653..cd9dff2 100644 --- a/invesalius/gui/widgets/slice_menu.py +++ b/invesalius/gui/widgets/slice_menu.py @@ -36,19 +36,19 @@ class SliceMenu(wx.Menu): #Window and level from DICOM new_id = wx.NewId() wl_item = wx.MenuItem(submenu_wl, new_id,\ - 'Default', kind=wx.ITEM_RADIO) + _('Default'), kind=wx.ITEM_RADIO) submenu_wl.AppendItem(wl_item) self.ID_TO_TOOL_ITEM[new_id] = wl_item #Case the user change window and level new_id = self.other_wl_id = wx.NewId() wl_item = wx.MenuItem(submenu_wl, new_id,\ - 'Manual', kind=wx.ITEM_RADIO) + _('Manual'), kind=wx.ITEM_RADIO) submenu_wl.AppendItem(wl_item) self.ID_TO_TOOL_ITEM[new_id] = wl_item for name in sorted(const.WINDOW_LEVEL): - if not(name == 'Default' or name == 'Manual'): + if not(name == _('Default') or name == _('Manual')): new_id = wx.NewId() wl_item = wx.MenuItem(submenu_wl, new_id,\ name, kind=wx.ITEM_RADIO) @@ -58,8 +58,8 @@ class SliceMenu(wx.Menu): #----------- Sub menu of the save and load options --------- submenu_wl.AppendSeparator() - options = ["Save current values", - "Save current values as...","Load values"] + options = [_("Save current values"), + _("Save current values as..."),_("Load values")] for name in options: new_id = wx.NewId() @@ -72,12 +72,12 @@ class SliceMenu(wx.Menu): submenu_pseudo_colours = wx.Menu() new_id = wx.NewId() color_item = wx.MenuItem(submenu_pseudo_colours, new_id,\ - 'Default ', kind=wx.ITEM_RADIO) + _("Default "), kind=wx.ITEM_RADIO) submenu_pseudo_colours.AppendItem(color_item) self.ID_TO_TOOL_ITEM[new_id] = color_item for name in sorted(const.SLICE_COLOR_TABLE): - if not(name == 'Default '): + if not(name == _("Default ")): new_id = wx.NewId() color_item = wx.MenuItem(submenu_wl, new_id,\ name, kind=wx.ITEM_RADIO) @@ -96,9 +96,9 @@ class SliceMenu(wx.Menu): # Add sub itens in the menu - self.AppendMenu(-1, "Window Width and Level", submenu_wl) - self.AppendMenu(-1, "Pseudo Colour", submenu_pseudo_colours) - self.AppendMenu(-1, "Image Tiling", submenu_image_tiling) + self.AppendMenu(-1, _("Window Width and Level"), submenu_wl) + self.AppendMenu(-1, _("Pseudo Colour"), submenu_pseudo_colours) + self.AppendMenu(-1, _("Image Tiling"), submenu_image_tiling) # It doesn't work in Linux self.Bind(wx.EVT_MENU, self.OnPopup) -- libgit2 0.21.2