Commit 2348f76ba6e35166af8b19f474013d320376d16c
1 parent
5879ee96
Exists in
master
and in
6 other branches
ADD: add "_" before string terms, reffer ticket fix #52
Showing
14 changed files
with
167 additions
and
168 deletions
Show diff stats
invesalius/gui/data_notebook.py
... | ... | @@ -39,10 +39,10 @@ class NotebookPanel(wx.Panel): |
39 | 39 | if sys.platform != 'win32': |
40 | 40 | book.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) |
41 | 41 | |
42 | - book.AddPage(MasksListCtrlPanel(book), "Masks") | |
43 | - book.AddPage(SurfacesListCtrlPanel(book), "Surfaces") | |
44 | - book.AddPage(MeasuresListCtrlPanel(book), "Measures") | |
45 | - book.AddPage(AnnotationsListCtrlPanel(book), "Annotations") | |
42 | + book.AddPage(MasksListCtrlPanel(book), _("Masks")) | |
43 | + book.AddPage(SurfacesListCtrlPanel(book), _("Surfaces")) | |
44 | + book.AddPage(MeasuresListCtrlPanel(book), _("Measures")) | |
45 | + book.AddPage(AnnotationsListCtrlPanel(book), _("Annotations")) | |
46 | 46 | |
47 | 47 | book.SetSelection(0) |
48 | 48 | |
... | ... | @@ -102,8 +102,8 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
102 | 102 | def __init_columns(self): |
103 | 103 | |
104 | 104 | self.InsertColumn(0, "", wx.LIST_FORMAT_CENTER) |
105 | - self.InsertColumn(1, "Name") | |
106 | - self.InsertColumn(2, "Threshold", wx.LIST_FORMAT_RIGHT) | |
105 | + self.InsertColumn(1, _("Name")) | |
106 | + self.InsertColumn(2, _("Threshold"), wx.LIST_FORMAT_RIGHT) | |
107 | 107 | |
108 | 108 | self.SetColumnWidth(0, 20) |
109 | 109 | self.SetColumnWidth(1, 120) |
... | ... | @@ -161,7 +161,7 @@ class MasksListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
161 | 161 | wx_image.SetData(new_image.tostring()) |
162 | 162 | return wx.BitmapFromImage(wx_image.Scale(16, 16)) |
163 | 163 | |
164 | - def InsertNewItem(self, index=0, label="Mask 1", threshold="(1000, 4500)", | |
164 | + def InsertNewItem(self, index=0, label=_("Mask 1"), threshold="(1000, 4500)", | |
165 | 165 | colour=None): |
166 | 166 | self.InsertStringItem(index, "") |
167 | 167 | self.SetStringItem(index, 1, label, |
... | ... | @@ -231,9 +231,9 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
231 | 231 | def __init_columns(self): |
232 | 232 | |
233 | 233 | self.InsertColumn(0, "", wx.LIST_FORMAT_CENTER) |
234 | - self.InsertColumn(1, "Name") | |
235 | - self.InsertColumn(2, "Volume (mm3)") | |
236 | - self.InsertColumn(3, "Transparency", wx.LIST_FORMAT_RIGHT) | |
234 | + self.InsertColumn(1, _("Name")) | |
235 | + self.InsertColumn(2, _("Volume (mm3)")) | |
236 | + self.InsertColumn(3, _("Transparency"), wx.LIST_FORMAT_RIGHT) | |
237 | 237 | |
238 | 238 | self.SetColumnWidth(0, 20) |
239 | 239 | self.SetColumnWidth(1, 85) |
... | ... | @@ -435,9 +435,9 @@ class AnnotationsListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
435 | 435 | def __init_columns(self): |
436 | 436 | |
437 | 437 | self.InsertColumn(0, "", wx.LIST_FORMAT_CENTER) |
438 | - self.InsertColumn(1, "Name") | |
439 | - self.InsertColumn(2, "Type", wx.LIST_FORMAT_CENTER) | |
440 | - self.InsertColumn(3, "Value") | |
438 | + self.InsertColumn(1, _("Name")) | |
439 | + self.InsertColumn(2, _("Type"), wx.LIST_FORMAT_CENTER) | |
440 | + self.InsertColumn(3, _("Value")) | |
441 | 441 | |
442 | 442 | self.SetColumnWidth(0, 20) |
443 | 443 | self.SetColumnWidth(1, 90) | ... | ... |
invesalius/gui/default_tasks.py
... | ... | @@ -166,7 +166,7 @@ class UpperTaskPanel(wx.Panel): |
166 | 166 | |
167 | 167 | # Fold 1 - Import |
168 | 168 | |
169 | - item = fold_panel.AddFoldPanel("1. InVesalius start", collapsed=True, | |
169 | + item = fold_panel.AddFoldPanel(_("1. InVesalius start"), collapsed=True, | |
170 | 170 | foldIcons=image_list) |
171 | 171 | style = fold_panel.GetCaptionStyle(item) |
172 | 172 | col = style.GetFirstColour() |
... | ... | @@ -179,7 +179,7 @@ class UpperTaskPanel(wx.Panel): |
179 | 179 | |
180 | 180 | # Fold 2 - Mask for segmentation and edition |
181 | 181 | |
182 | - item = fold_panel.AddFoldPanel("2. Select region of interest", | |
182 | + item = fold_panel.AddFoldPanel(_("2. Select region of interest"), | |
183 | 183 | collapsed=True, foldIcons=image_list) |
184 | 184 | style = fold_panel.GetCaptionStyle(item) |
185 | 185 | col = style.GetFirstColour() |
... | ... | @@ -196,7 +196,7 @@ class UpperTaskPanel(wx.Panel): |
196 | 196 | # apply button |
197 | 197 | # Contour - slider |
198 | 198 | # enable / disable Fill holes |
199 | - item = fold_panel.AddFoldPanel("3. Configure 3D surface", collapsed=True, | |
199 | + item = fold_panel.AddFoldPanel(_("3. Configure 3D surface"), collapsed=True, | |
200 | 200 | foldIcons=image_list) |
201 | 201 | style = fold_panel.GetCaptionStyle(item) |
202 | 202 | col = style.GetFirstColour() |
... | ... | @@ -207,7 +207,7 @@ class UpperTaskPanel(wx.Panel): |
207 | 207 | |
208 | 208 | # Fold 4 |
209 | 209 | # Export volume |
210 | - item = fold_panel.AddFoldPanel("4. Export data", collapsed=True, | |
210 | + item = fold_panel.AddFoldPanel(_("4. Export data"), collapsed=True, | |
211 | 211 | foldIcons=image_list) |
212 | 212 | style = fold_panel.GetCaptionStyle(item) |
213 | 213 | col = style.GetFirstColour() | ... | ... |
invesalius/gui/default_viewers.py
... | ... | @@ -76,23 +76,23 @@ class Panel(wx.Panel): |
76 | 76 | |
77 | 77 | p1 = slice_viewer.Viewer(self, "AXIAL") |
78 | 78 | s1 = wx.aui.AuiPaneInfo().Centre().Row(0).\ |
79 | - Name("Axial Slice").Caption("Axial slice").\ | |
79 | + Name("Axial Slice").Caption(_("Axial slice")).\ | |
80 | 80 | MaximizeButton(True).CloseButton(False) |
81 | 81 | |
82 | 82 | p2 = slice_viewer.Viewer(self, "CORONAL") |
83 | 83 | s2 = wx.aui.AuiPaneInfo().Centre().Row(0).\ |
84 | - Name("Coronal Slice").Caption("Coronal slice").\ | |
84 | + Name("Coronal Slice").Caption(_("Coronal slice")).\ | |
85 | 85 | MaximizeButton(True).CloseButton(False) |
86 | 86 | |
87 | 87 | p3 = slice_viewer.Viewer(self, "SAGITAL") |
88 | 88 | s3 = wx.aui.AuiPaneInfo().Centre().Row(1).\ |
89 | - Name("Sagital Slice").Caption("Sagital slice").\ | |
89 | + Name("Sagital Slice").Caption(_("Sagital slice")).\ | |
90 | 90 | MaximizeButton(True).CloseButton(False) |
91 | 91 | |
92 | 92 | p4 = VolumeViewerCover(self) |
93 | 93 | #p4 = volume_viewer.Viewer(self) |
94 | 94 | s4 = wx.aui.AuiPaneInfo().Row(1).Name("Volume").\ |
95 | - Bottom().Centre().Caption("Volume").\ | |
95 | + Bottom().Centre().Caption(_("Volume")).\ | |
96 | 96 | MaximizeButton(True).CloseButton(False) |
97 | 97 | |
98 | 98 | self.s4 = s4 |
... | ... | @@ -165,25 +165,25 @@ class Panel(wx.Panel): |
165 | 165 | p1 = slice_viewer.Viewer(self, "AXIAL") |
166 | 166 | aui_manager.AddPane(p1, |
167 | 167 | wx.aui.AuiPaneInfo(). |
168 | - Name("Axial Slice").Caption("Axial slice"). | |
168 | + Name("Axial Slice").Caption(_("Axial slice")). | |
169 | 169 | MaximizeButton(True).CloseButton(False)) |
170 | 170 | |
171 | 171 | p2 = slice_viewer.Viewer(self, "CORONAL") |
172 | 172 | aui_manager.AddPane(p2, |
173 | 173 | wx.aui.AuiPaneInfo(). |
174 | - Name("Coronal Slice").Caption("Coronal slice"). | |
174 | + Name("Coronal Slice").Caption(_("Coronal slice")). | |
175 | 175 | MaximizeButton(True).CloseButton(False)) |
176 | 176 | |
177 | 177 | p3 = slice_viewer.Viewer(self, "SAGITAL") |
178 | 178 | aui_manager.AddPane(p3, |
179 | 179 | wx.aui.AuiPaneInfo(). |
180 | - Name("Sagittal Slice").Caption("Sagittal slice"). | |
180 | + Name("Sagittal Slice").Caption(_("Sagittal slice")). | |
181 | 181 | MaximizeButton(True).CloseButton(False)) |
182 | 182 | |
183 | 183 | #p4 = volume_viewer.Viewer(self) |
184 | 184 | aui_manager.AddPane(VolumeViewerCover, |
185 | 185 | wx.aui.AuiPaneInfo(). |
186 | - Name("Volume").Caption("Volume"). | |
186 | + Name("Volume").Caption(_("Volume")). | |
187 | 187 | MaximizeButton(True).CloseButton(False)) |
188 | 188 | |
189 | 189 | splitter.AppendWindow(p1) |
... | ... | @@ -406,7 +406,7 @@ class VolumeToolPanel(wx.Panel): |
406 | 406 | self.button_slice_plane.PopupMenu(self.slice_plane_menu) |
407 | 407 | |
408 | 408 | def OnSavePreset(self, evt): |
409 | - d = wx.TextEntryDialog(self, "Preset name") | |
409 | + d = wx.TextEntryDialog(self, _("Preset name")) | |
410 | 410 | if d.ShowModal() == wx.ID_OK: |
411 | 411 | preset_name = d.GetValue() |
412 | 412 | ps.Publisher().sendMessage('Save raycasting preset', |
... | ... | @@ -434,7 +434,7 @@ class VolumeToolPanel(wx.Panel): |
434 | 434 | ID_TO_TOOL_ITEM[id] = item |
435 | 435 | TOOL_STATE[id] = False |
436 | 436 | self.submenu_raycasting_tools = submenu |
437 | - menu.AppendMenu(RAYCASTING_TOOLS, "Tools", submenu) | |
437 | + menu.AppendMenu(RAYCASTING_TOOLS, _("Tools"), submenu) | |
438 | 438 | menu.Enable(RAYCASTING_TOOLS, 0) |
439 | 439 | |
440 | 440 | self.menu_raycasting = menu | ... | ... |
invesalius/gui/dialogs.py
... | ... | @@ -48,11 +48,11 @@ class NumberDialog(wx.Dialog): |
48 | 48 | |
49 | 49 | # Buttons |
50 | 50 | btn_ok = wx.Button(self, wx.ID_OK) |
51 | - btn_ok.SetHelpText("Above value will be applied.") | |
51 | + btn_ok.SetHelpText(_("Above value will be applied.")) | |
52 | 52 | btn_ok.SetDefault() |
53 | 53 | |
54 | 54 | btn_cancel = wx.Button(self, wx.ID_CANCEL) |
55 | - btn_cancel.SetHelpText("Value will not be applied.") | |
55 | + btn_cancel.SetHelpText(_("Value will not be applied.")) | |
56 | 56 | |
57 | 57 | btnsizer = wx.StdDialogButtonSizer() |
58 | 58 | btnsizer.AddButton(btn_ok) |
... | ... | @@ -90,7 +90,7 @@ def ShowNumberDialog(message, value=0): |
90 | 90 | class ProgressDialog(object): |
91 | 91 | def __init__(self, maximum): |
92 | 92 | self.title = "InVesalius 3" |
93 | - self.msg = "Loading DICOM files" | |
93 | + self.msg = _("Loading DICOM files") | |
94 | 94 | self.maximum = maximum |
95 | 95 | self.current = 0 |
96 | 96 | self.style = wx.PD_CAN_ABORT | wx.PD_APP_MODAL |
... | ... | @@ -138,7 +138,7 @@ WILDCARD_OPEN = "InVesalius 3 project (*.inv3)|*.inv3|"\ |
138 | 138 | def ShowOpenProjectDialog(): |
139 | 139 | # Default system path |
140 | 140 | current_dir = os.path.abspath(".") |
141 | - dlg = wx.FileDialog(None, message="Open InVesalius 3 project...", | |
141 | + dlg = wx.FileDialog(None, message=_("Open InVesalius 3 project..."), | |
142 | 142 | defaultDir="", |
143 | 143 | defaultFile="", wildcard=WILDCARD_OPEN, |
144 | 144 | style=wx.OPEN|wx.CHANGE_DIR) |
... | ... | @@ -161,7 +161,7 @@ def ShowOpenProjectDialog(): |
161 | 161 | |
162 | 162 | def ShowImportDirDialog(): |
163 | 163 | current_dir = os.path.abspath(".") |
164 | - dlg = wx.DirDialog(None, "Choose a DICOM folder:", "", | |
164 | + dlg = wx.DirDialog(None, _("Choose a DICOM folder:"), "", | |
165 | 165 | style=wx.DD_DEFAULT_STYLE |
166 | 166 | | wx.DD_DIR_MUST_EXIST |
167 | 167 | | wx.DD_CHANGE_DIR) |
... | ... | @@ -183,10 +183,10 @@ def ShowImportDirDialog(): |
183 | 183 | def ShowSaveAsProjectDialog(default_filename=None): |
184 | 184 | current_dir = os.path.abspath(".") |
185 | 185 | dlg = wx.FileDialog(None, |
186 | - "Save project as...", # title | |
186 | + _("Save project as..."), # title | |
187 | 187 | "", # last used directory |
188 | 188 | default_filename, |
189 | - "InVesalius project (*.inv3)|*.inv3", | |
189 | + _("InVesalius project (*.inv3)|*.inv3"), | |
190 | 190 | wx.SAVE|wx.OVERWRITE_PROMPT) |
191 | 191 | #dlg.SetFilterIndex(0) # default is VTI |
192 | 192 | |
... | ... | @@ -249,7 +249,7 @@ class MessageDialog(wx.Dialog): |
249 | 249 | self.Centre() |
250 | 250 | |
251 | 251 | def SaveChangesDialog__Old(filename): |
252 | - message = "Save changes to %s?"%filename | |
252 | + message = _("Save changes to %s?")%filename | |
253 | 253 | dlg = MessageDialog(message) |
254 | 254 | |
255 | 255 | answer = dlg.ShowModal() |
... | ... | @@ -276,7 +276,7 @@ def ImportEmptyDirectory(dirpath): |
276 | 276 | dlg.Destroy() |
277 | 277 | |
278 | 278 | def ImportInvalidFiles(): |
279 | - msg = "There are no DICOM files on the selected directory." | |
279 | + msg = _("There are no DICOM files on the selected directory.") | |
280 | 280 | if sys.platform == 'darwin': |
281 | 281 | dlg = wx.MessageDialog(None, "", msg, |
282 | 282 | wx.ICON_INFORMATION | wx.OK) |
... | ... | @@ -288,7 +288,7 @@ def ImportInvalidFiles(): |
288 | 288 | |
289 | 289 | def SaveChangesDialog(filename): |
290 | 290 | current_dir = os.path.abspath(".") |
291 | - msg = "Save changes to %s?"%filename | |
291 | + msg = _("Save changes to %s?")%filename | |
292 | 292 | if sys.platform == 'darwin': |
293 | 293 | dlg = wx.MessageDialog(None, "", msg, |
294 | 294 | wx.ICON_QUESTION | wx.YES_NO | wx.CANCEL) |
... | ... | @@ -310,7 +310,7 @@ def SaveChangesDialog(filename): |
310 | 310 | |
311 | 311 | def SaveChangesDialog2(filename): |
312 | 312 | current_dir = os.path.abspath(".") |
313 | - msg = "Save changes to %s?"%filename | |
313 | + msg = _("Save changes to %s?")%filename | |
314 | 314 | if sys.platform == 'darwin': |
315 | 315 | dlg = wx.MessageDialog(None, "", msg, |
316 | 316 | wx.ICON_QUESTION | wx.YES_NO) |
... | ... | @@ -334,16 +334,16 @@ def ShowAboutDialog(parent): |
334 | 334 | info = wx.AboutDialogInfo() |
335 | 335 | info.Name = "InVesalius" |
336 | 336 | info.Version = "3.a.1 - RP" |
337 | - info.Copyright = "(C) 2007 Renato Archer Research Centre" | |
337 | + info.Copyright = _("(C) 2007 Renato Archer Research Centre") | |
338 | 338 | info.Description = wordwrap( |
339 | - "InVesalius is a software for medical imaging 3D reconstruction. "+\ | |
340 | - "Its input is a sequency of DICOM 2D image files acquired with CT or MR.\n\n"+\ | |
341 | - "The software also allows generating correspondent STL files,"+\ | |
342 | - "so the user can print 3D physical models of the patient's anatomy "+\ | |
343 | - "using Rapid Prototyping.", 350, wx.ClientDC(parent)) | |
339 | + _("InVesalius is a software for medical imaging 3D reconstruction. ")+\ | |
340 | + _("Its input is a sequency of DICOM 2D image files acquired with CT or MR.\n\n")+\ | |
341 | + _("The software also allows generating correspondent STL files,")+\ | |
342 | + _("so the user can print 3D physical models of the patient's anatomy ")+\ | |
343 | + _("using Rapid Prototyping."), 350, wx.ClientDC(parent)) | |
344 | 344 | info.WebSite = ("http://www.softwarepublico.gov.br/", |
345 | 345 | "InVesalius Community") |
346 | - info.License = "GNU GPL (General Public License) version 2" | |
346 | + info.License = _("GNU GPL (General Public License) version 2") | |
347 | 347 | |
348 | 348 | #info.Translators = "" |
349 | 349 | #info.Artists = |
... | ... | @@ -358,7 +358,7 @@ def ShowAboutDialog(parent): |
358 | 358 | |
359 | 359 | def ShowSavePresetDialog(default_filename="raycasting"): |
360 | 360 | dlg = wx.TextEntryDialog(None, |
361 | - "Save raycasting preset as:", | |
361 | + _("Save raycasting preset as:"), | |
362 | 362 | "InVesalius 3") |
363 | 363 | #dlg.SetFilterIndex(0) # default is VTI |
364 | 364 | filename = None | ... | ... |
invesalius/gui/dicom_preview_panel.py
... | ... | @@ -39,11 +39,11 @@ NCOLS = 6 |
39 | 39 | MAX_VALUE = NCOLS*NROWS |
40 | 40 | |
41 | 41 | |
42 | -STR_SIZE = "Image size: %d x %d" | |
43 | -STR_SPC = "Spacing: %.2f" | |
44 | -STR_LOCAL = "Location: %.2f" | |
42 | +STR_SIZE = _("Image size: %d x %d") | |
43 | +STR_SPC = _("Spacing: %.2f") | |
44 | +STR_LOCAL = _("Location: %.2f") | |
45 | 45 | STR_PATIENT = "%s\n%s" |
46 | -STR_ACQ = "%s %s\nMade in InVesalius" | |
46 | +STR_ACQ = _("%s %s\nMade in InVesalius") | |
47 | 47 | |
48 | 48 | class SingleImagePreview(wx.Panel): |
49 | 49 | def __init__(self, parent): |
... | ... | @@ -63,7 +63,7 @@ class SingleImagePreview(wx.Panel): |
63 | 63 | |
64 | 64 | text_image_size = vtku.Text() |
65 | 65 | text_image_size.SetPosition(const.TEXT_POS_LEFT_UP) |
66 | - text_image_size.SetValue("image size") | |
66 | + text_image_size.SetValue(_("image size")) | |
67 | 67 | self.text_image_size = text_image_size |
68 | 68 | |
69 | 69 | text_image_location = vtku.Text() |
... | ... | @@ -72,14 +72,14 @@ class SingleImagePreview(wx.Panel): |
72 | 72 | text_image_location.SetValue("localization") |
73 | 73 | self.text_image_location = text_image_location |
74 | 74 | |
75 | - value = "id\nprotocol" | |
75 | + value = _("id\nprotocol") | |
76 | 76 | text_patient = vtku.Text() |
77 | 77 | text_patient.SetJustificationToRight() |
78 | 78 | text_patient.SetPosition(const.TEXT_POS_RIGHT_UP) |
79 | 79 | text_patient.SetValue(value) |
80 | 80 | self.text_patient = text_patient |
81 | 81 | |
82 | - value = "date time\n Made in InVesalius" | |
82 | + value = _("date time\n Made in InVesalius") | |
83 | 83 | text_acquisition = vtku.Text() |
84 | 84 | text_acquisition.SetJustificationToRight() |
85 | 85 | text_acquisition.SetVerticalJustificationToBottom() |
... | ... | @@ -125,7 +125,7 @@ class SingleImagePreview(wx.Panel): |
125 | 125 | slider.SetTickFreq(1, 1) |
126 | 126 | self.slider = slider |
127 | 127 | |
128 | - checkbox = wx.CheckBox(self, -1, "Auto-play") | |
128 | + checkbox = wx.CheckBox(self, -1, _("Auto-play")) | |
129 | 129 | self.checkbox = checkbox |
130 | 130 | |
131 | 131 | in_sizer = wx.BoxSizer(wx.HORIZONTAL) |
... | ... | @@ -279,10 +279,10 @@ class Preview(wx.Panel): |
279 | 279 | |
280 | 280 | def _init_ui(self): |
281 | 281 | |
282 | - self.title = wx.StaticText(self, -1, "Image", | |
282 | + self.title = wx.StaticText(self, -1, _("Image"), | |
283 | 283 | style=wx.ALIGN_CENTER) |
284 | 284 | |
285 | - self.subtitle = wx.StaticText(self, -1, "Image", | |
285 | + self.subtitle = wx.StaticText(self, -1, _("Image"), | |
286 | 286 | style=wx.ALIGN_CENTER) |
287 | 287 | |
288 | 288 | self.image_viewer = wx.StaticBitmap(self, -1) |
... | ... | @@ -615,7 +615,7 @@ class DicomPreviewSeries(wx.Panel): |
615 | 615 | float(group.dicom.image.window), |
616 | 616 | float(group.dicom.image.level), |
617 | 617 | group.title, |
618 | - "%d Images" %(group.nslices), | |
618 | + _("%d Images") %(group.nslices), | |
619 | 619 | n, |
620 | 620 | group_list, |
621 | 621 | group.dicom) |
... | ... | @@ -736,7 +736,7 @@ class DicomPreview(wx.Panel): |
736 | 736 | info = (dicom.image.imagedata, |
737 | 737 | dicom.image.window, |
738 | 738 | dicom.image.level, |
739 | - "Image %d" % (dicom.image.number), | |
739 | + _("Image %d") % (dicom.image.number), | |
740 | 740 | "%.2f" % (dicom.image.position[2]), |
741 | 741 | n, |
742 | 742 | dicom) |
... | ... | @@ -761,7 +761,7 @@ class DicomPreview(wx.Panel): |
761 | 761 | info = (dicom.image, |
762 | 762 | dicom.image.window, |
763 | 763 | dicom.image.level, |
764 | - "Image %d" % (dicom.image.number), | |
764 | + _("Image %d") % (dicom.image.number), | |
765 | 765 | "%.2f" % (dicom.image.position[2]), |
766 | 766 | n, |
767 | 767 | dicom) | ... | ... |
invesalius/gui/frame.py
... | ... | @@ -80,8 +80,8 @@ class Frame(wx.Frame): |
80 | 80 | |
81 | 81 | def __bind_events(self): |
82 | 82 | ps.Publisher().subscribe(self.ShowContentPanel, 'Show content panel') |
83 | - ps.Publisher().subscribe(self.ShowImportPanel, "Show import panel in frame") | |
84 | - ps.Publisher().subscribe(self.UpdateAui, "Update AUI") | |
83 | + ps.Publisher().subscribe(self.ShowImportPanel, 'Show import panel in frame') | |
84 | + ps.Publisher().subscribe(self.UpdateAui, 'Update AUI') | |
85 | 85 | ps.Publisher().subscribe(self.ShowTask, 'Show task panel') |
86 | 86 | ps.Publisher().subscribe(self.HideTask, 'Hide task panel') |
87 | 87 | ps.Publisher().subscribe(self.SetProjectName, 'Set project name') |
... | ... | @@ -135,7 +135,7 @@ class Frame(wx.Frame): |
135 | 135 | |
136 | 136 | |
137 | 137 | aui_manager.AddPane(viewers.Panel(self), wx.aui.AuiPaneInfo(). |
138 | - Caption("Data panel").CaptionVisible(False). | |
138 | + Caption(_("Data panel")).CaptionVisible(False). | |
139 | 139 | Centre().CloseButton(False).Floatable(False). |
140 | 140 | Hide().Layer(1).MaximizeButton(True).Name("Data"). |
141 | 141 | Position(1)) |
... | ... | @@ -144,7 +144,7 @@ class Frame(wx.Frame): |
144 | 144 | aui_manager.AddPane(imp.Panel(self), wx.aui.AuiPaneInfo(). |
145 | 145 | Name("Import").Centre().Hide(). |
146 | 146 | MaximizeButton(True).Floatable(True). |
147 | - Caption("Preview medical data to be reconstructed"). | |
147 | + Caption(_("Preview medical data to be reconstructed")). | |
148 | 148 | CaptionVisible(True)) |
149 | 149 | |
150 | 150 | |
... | ... | @@ -303,11 +303,11 @@ class MenuBar(wx.MenuBar): |
303 | 303 | # FILE |
304 | 304 | file_menu = wx.Menu() |
305 | 305 | #file_menu.Append(const.ID_DICOM_LOAD_NET, "Import DICOM from Internet...") |
306 | - file_menu.Append(const.ID_DICOM_IMPORT, "Import DICOM...\tCtrl+I") | |
307 | - file_menu.Append(const.ID_PROJECT_OPEN, "Open Project...\tCtrl+O") | |
308 | - file_menu.Append(const.ID_PROJECT_SAVE, "Save Project\tCtrl+S") | |
309 | - file_menu.Append(const.ID_PROJECT_SAVE_AS, "Save Project As...") | |
310 | - file_menu.Append(const.ID_PROJECT_CLOSE, "Close Project") | |
306 | + file_menu.Append(const.ID_DICOM_IMPORT, _("Import DICOM...\tCtrl+I")) | |
307 | + file_menu.Append(const.ID_PROJECT_OPEN, _("Open Project...\tCtrl+O")) | |
308 | + file_menu.Append(const.ID_PROJECT_SAVE, _("Save Project\tCtrl+S")) | |
309 | + file_menu.Append(const.ID_PROJECT_SAVE_AS, _("Save Project As...")) | |
310 | + file_menu.Append(const.ID_PROJECT_CLOSE, _("Close Project")) | |
311 | 311 | file_menu.AppendSeparator() |
312 | 312 | #file_menu.Append(const.ID_PROJECT_INFO, "Project Information...") |
313 | 313 | #file_menu.AppendSeparator() |
... | ... | @@ -316,7 +316,7 @@ class MenuBar(wx.MenuBar): |
316 | 316 | #file_menu.AppendSeparator() |
317 | 317 | #file_menu.Append(1, "C:\InvData\sample.inv") |
318 | 318 | #file_menu.AppendSeparator() |
319 | - file_menu.Append(const.ID_EXIT, "Exit") | |
319 | + file_menu.Append(const.ID_EXIT, _("Exit")) | |
320 | 320 | |
321 | 321 | # EDIT |
322 | 322 | #file_edit = wx.Menu() |
... | ... | @@ -355,10 +355,10 @@ class MenuBar(wx.MenuBar): |
355 | 355 | |
356 | 356 | # HELP |
357 | 357 | help_menu = wx.Menu() |
358 | - help_menu.Append(105, "Getting Started...") | |
358 | + help_menu.Append(105, _("Getting Started...")) | |
359 | 359 | #help_menu.Append(108, "User Manual...") |
360 | 360 | help_menu.AppendSeparator() |
361 | - help_menu.Append(const.ID_ABOUT, "About...") | |
361 | + help_menu.Append(const.ID_ABOUT, _("About...")) | |
362 | 362 | #help_menu.Append(107, "Check For Updates Now...") |
363 | 363 | |
364 | 364 | # TODO: Check what is necessary under MacOS to show Groo and not Python |
... | ... | @@ -369,12 +369,12 @@ class MenuBar(wx.MenuBar): |
369 | 369 | #test_item = test_menu.Append(-1, '&About Groo', 'Groo RULES!!!') |
370 | 370 | #wx.App.SetMacAboutMenuItemId(test_item.GetId()) |
371 | 371 | |
372 | - self.Append(file_menu, "File") | |
372 | + self.Append(file_menu, _("File")) | |
373 | 373 | #self.Append(file_edit, "Edit") |
374 | 374 | #self.Append(view_menu, "View") |
375 | 375 | #self.Append(tools_menu, "Tools") |
376 | 376 | #self.Append(options_menu, "Options") |
377 | - self.Append(help_menu, "Help") | |
377 | + self.Append(help_menu, _("Help")) | |
378 | 378 | |
379 | 379 | def __bind_events(self): |
380 | 380 | # TODO: in future, possibly when wxPython 2.9 is available, |
... | ... | @@ -417,7 +417,7 @@ class StatusBar(wx.StatusBar): |
417 | 417 | wx.StatusBar.__init__(self, parent, -1) |
418 | 418 | self.SetFieldsCount(3) |
419 | 419 | self.SetStatusWidths([-2,-2,-1]) |
420 | - self.SetStatusText("Ready", 0) | |
420 | + self.SetStatusText(_("Ready"), 0) | |
421 | 421 | self.SetStatusText("", 1) |
422 | 422 | self.SetStatusText("", 2) |
423 | 423 | |
... | ... | @@ -525,13 +525,13 @@ class ProjectToolBar(wx.ToolBar): |
525 | 525 | # "Load medical image...", |
526 | 526 | # BMP_NET) |
527 | 527 | self.AddLabelTool(const.ID_DICOM_IMPORT, |
528 | - "Import medical image...", | |
528 | + _("Import medical image..."), | |
529 | 529 | BMP_IMPORT) |
530 | 530 | self.AddLabelTool(const.ID_PROJECT_OPEN, |
531 | - "Open InVesalius 3 project...", | |
531 | + _("Open InVesalius 3 project..."), | |
532 | 532 | BMP_OPEN) |
533 | 533 | self.AddLabelTool(const.ID_PROJECT_SAVE, |
534 | - "Save InVesalius project", | |
534 | + _("Save InVesalius project"), | |
535 | 535 | BMP_SAVE) |
536 | 536 | #self.AddLabelTool(const.ID_SAVE_SCREENSHOT, |
537 | 537 | # "Take photo of screen", |
... | ... | @@ -626,25 +626,25 @@ class ObjectToolBar(wx.ToolBar): |
626 | 626 | wx.BITMAP_TYPE_PNG) |
627 | 627 | |
628 | 628 | self.AddLabelTool(const.STATE_ZOOM, |
629 | - "Zoom", | |
629 | + _("Zoom"), | |
630 | 630 | BMP_ZOOM, |
631 | 631 | kind = wx.ITEM_CHECK) |
632 | 632 | |
633 | 633 | self.AddLabelTool(const.STATE_ZOOM_SL, |
634 | - "Zoom based on selection", | |
634 | + _("Zoom based on selection"), | |
635 | 635 | BMP_ZOOM_SELECT, |
636 | 636 | kind = wx.ITEM_CHECK) |
637 | 637 | |
638 | 638 | self.AddLabelTool(const.STATE_SPIN, |
639 | - "Rotate", BMP_ROTATE, | |
639 | + _("Rotate"), BMP_ROTATE, | |
640 | 640 | kind = wx.ITEM_CHECK) |
641 | 641 | |
642 | 642 | self.AddLabelTool(const.STATE_PAN, |
643 | - "Move", BMP_MOVE, | |
643 | + _("Move"), BMP_MOVE, | |
644 | 644 | kind = wx.ITEM_CHECK) |
645 | 645 | |
646 | 646 | self.AddLabelTool(const.STATE_WL, |
647 | - "Window and Level", BMP_CONTRAST, | |
647 | + _("Window and Level"), BMP_CONTRAST, | |
648 | 648 | kind = wx.ITEM_CHECK) |
649 | 649 | self.Realize() |
650 | 650 | ... | ... |
invesalius/gui/import_data_wizard.py
... | ... | @@ -184,8 +184,8 @@ class DirPage(BasePage): |
184 | 184 | |
185 | 185 | def __init_specific_gui(self): |
186 | 186 | |
187 | - line1 = wx.StaticText(self, -1,"Select the directory which "+\ | |
188 | - "contains medical images of the study interest.") | |
187 | + line1 = wx.StaticText(self, -1,_("Select the directory which ")+\ | |
188 | + _("contains medical images of the study interest.")) | |
189 | 189 | |
190 | 190 | |
191 | 191 | |
... | ... | @@ -229,14 +229,14 @@ class DirPage(BasePage): |
229 | 229 | style.SetSecondColour(wx.Colour(255,255,255)) |
230 | 230 | |
231 | 231 | # Fold 1 - Surface properties |
232 | - item = fold_panel.AddFoldPanel("Advanced options", | |
232 | + item = fold_panel.AddFoldPanel(_("Advanced options"), | |
233 | 233 | collapsed=True) |
234 | 234 | fold_panel.ApplyCaptionStyle(item, style) |
235 | 235 | fold_panel.AddFoldPanelWindow(item, |
236 | - wx.CheckBox(item, wx.ID_ANY, "Use selected folder(s) as default"), | |
236 | + wx.CheckBox(item, wx.ID_ANY, _("Use selected folder(s) as default")), | |
237 | 237 | Spacing= 0, leftSpacing=0, rightSpacing=0) |
238 | 238 | fold_panel.AddFoldPanelWindow(item, |
239 | - wx.CheckBox(item, wx.ID_ANY, "Enable recursion in folder(s)"), | |
239 | + wx.CheckBox(item, wx.ID_ANY, _("Enable recursion in folder(s)")), | |
240 | 240 | Spacing= 0, leftSpacing=0, rightSpacing=0) |
241 | 241 | |
242 | 242 | |
... | ... | @@ -252,18 +252,18 @@ class DirPage(BasePage): |
252 | 252 | self.next.GetNext().DecreasePageNumber() |
253 | 253 | |
254 | 254 | def OnAddDir(self, evt): |
255 | - dlg = wx.DirDialog(self, "Choose a directory:", | |
255 | + dlg = wx.DirDialog(self, _("Choose a directory:"), | |
256 | 256 | style=wx.DD_DIR_MUST_EXIST) |
257 | 257 | |
258 | 258 | if dlg.ShowModal() == wx.ID_OK: |
259 | 259 | path = dlg.GetPath() |
260 | 260 | self.selected_dir.append(path) |
261 | - self.link_add_new.SetLabel("Add another directory") | |
261 | + self.link_add_new.SetLabel(_("Add another directory")) | |
262 | 262 | self.AddNewDir(path) |
263 | 263 | dlg.Destroy() |
264 | 264 | |
265 | 265 | def OnChangeDir(self, prev_dir, text): |
266 | - dlg = wx.DirDialog(self, "Choose a directory:", | |
266 | + dlg = wx.DirDialog(self, _("Choose a directory:"), | |
267 | 267 | style=wx.DD_DIR_MUST_EXIST) |
268 | 268 | dlg.SetPath(prev_dir) |
269 | 269 | |
... | ... | @@ -282,8 +282,8 @@ class DirPage(BasePage): |
282 | 282 | |
283 | 283 | text_dir_path = wx.StaticText(self, -1, path) |
284 | 284 | |
285 | - tooltip = wx.ToolTip("Remove this directory from list") | |
286 | - link_remove = hl.HyperLinkCtrl(self, -1,"Remove") | |
285 | + tooltip = wx.ToolTip(_("Remove this directory from list")) | |
286 | + link_remove = hl.HyperLinkCtrl(self, -1,_("Remove")) | |
287 | 287 | link_remove.SetUnderlines(True, False, False) |
288 | 288 | link_remove.SetColours("BLUE", "BLUE", "BLUE") |
289 | 289 | link_remove.SetToolTip(tooltip) |
... | ... | @@ -308,7 +308,7 @@ class DirPage(BasePage): |
308 | 308 | self.line3.Hide(sizer) |
309 | 309 | self.line3.RemoveSizer(sizer) |
310 | 310 | if not self.selected_dir: |
311 | - self.link_add_new.SetLabel("Add another directory") | |
311 | + self.link_add_new.SetLabel(_("Add another directory")) | |
312 | 312 | self.Layout() |
313 | 313 | self.Fit() |
314 | 314 | |
... | ... | @@ -337,15 +337,15 @@ class DirPage(BasePage): |
337 | 337 | self.log.write('DirBrowseButton: %s\n' % evt.GetString()) |
338 | 338 | |
339 | 339 | def CreateWizard(parent): |
340 | - wizard = wiz.Wizard(parent, -1, "Import medical images", getWizTest1Bitmap()) | |
340 | + wizard = wiz.Wizard(parent, -1, _("Import medical images"), getWizTest1Bitmap()) | |
341 | 341 | |
342 | - page1 = DirPage(wizard, "Choose directory", 1) | |
343 | - page2 = RawDataPage(wizard, "Define RAW data", 2) | |
344 | - page3 = StudyPage(wizard, "Select study", 3) # 2 can be 3 | |
342 | + page1 = DirPage(wizard, _("Choose directory"), 1) | |
343 | + page2 = RawDataPage(wizard, _("Define RAW data"), 2) | |
344 | + page3 = StudyPage(wizard, _("Select study"), 3) # 2 can be 3 | |
345 | 345 | |
346 | 346 | |
347 | 347 | wizard.FitToPage(page1) |
348 | - page3.sizer.Add(wx.StaticText(page3, -1, "\nThis is the last page.")) | |
348 | + page3.sizer.Add(wx.StaticText(page3, -1, _("\nThis is the last page."))) | |
349 | 349 | |
350 | 350 | # Set the initial order of the pages |
351 | 351 | page1.SetNext(page2) | ... | ... |
invesalius/gui/import_panel.py
... | ... | @@ -51,7 +51,7 @@ class InnerPanel(wx.Panel): |
51 | 51 | self.splitter = splitter |
52 | 52 | |
53 | 53 | panel = wx.Panel(self) |
54 | - button = wx.Button(panel, -1, "Import medical images", (20, 20)) | |
54 | + button = wx.Button(panel, -1, _("Import medical images"), (20, 20)) | |
55 | 55 | |
56 | 56 | inner_sizer = wx.BoxSizer() |
57 | 57 | inner_sizer.Add(button, 0, wx.ALIGN_CENTER_HORIZONTAL, 40) |
... | ... | @@ -106,18 +106,18 @@ class TextPanel(wx.Panel): |
106 | 106 | ) |
107 | 107 | |
108 | 108 | |
109 | - tree.AddColumn("Patient name") | |
110 | - tree.AddColumn("Patient ID") | |
111 | - tree.AddColumn("Age") | |
112 | - tree.AddColumn("Gender") | |
113 | - tree.AddColumn("Study description") | |
114 | - tree.AddColumn("Modality") | |
115 | - tree.AddColumn("Date acquired") | |
116 | - tree.AddColumn("# Images") | |
117 | - tree.AddColumn("Institution") | |
118 | - tree.AddColumn("Date of birth") | |
119 | - tree.AddColumn("Accession Number") | |
120 | - tree.AddColumn("Referring physician") | |
109 | + tree.AddColumn(_("Patient name")) | |
110 | + tree.AddColumn(_("Patient ID")) | |
111 | + tree.AddColumn(_("Age")) | |
112 | + tree.AddColumn(_("Gender")) | |
113 | + tree.AddColumn(_("Study description")) | |
114 | + tree.AddColumn(_("Modality")) | |
115 | + tree.AddColumn(_("Date acquired")) | |
116 | + tree.AddColumn(_("# Images")) | |
117 | + tree.AddColumn(_("Institution")) | |
118 | + tree.AddColumn(_("Date of birth")) | |
119 | + tree.AddColumn(_("Accession Number")) | |
120 | + tree.AddColumn(_("Referring physician")) | |
121 | 121 | |
122 | 122 | tree.SetMainColumn(0) # the one with the tree in it... |
123 | 123 | tree.SetColumnWidth(0, 280) # Patient name |
... | ... | @@ -133,7 +133,7 @@ class TextPanel(wx.Panel): |
133 | 133 | tree.SetColumnWidth(10, 140) # Accession Number |
134 | 134 | tree.SetColumnWidth(11, 160) # Referring physician |
135 | 135 | |
136 | - self.root = tree.AddRoot("InVesalius Database") | |
136 | + self.root = tree.AddRoot(_("InVesalius Database")) | |
137 | 137 | self.tree = tree |
138 | 138 | |
139 | 139 | def SelectSeries(self, pubsub_evt): |
... | ... | @@ -293,8 +293,7 @@ class SeriesPanel(wx.Panel): |
293 | 293 | |
294 | 294 | self.dicom_preview.Show(0) |
295 | 295 | self.serie_preview.Show(1) |
296 | - | |
297 | - | |
296 | + | |
298 | 297 | self.serie_preview.SetPatientGroups(patient) |
299 | 298 | self.dicom_preview.SetPatientGroups(patient) |
300 | 299 | ... | ... |
invesalius/gui/task_exporter.py
... | ... | @@ -98,9 +98,9 @@ class InnerTaskPanel(wx.Panel): |
98 | 98 | # Counter for projects loaded in current GUI |
99 | 99 | |
100 | 100 | # Fixed hyperlink items |
101 | - tooltip = wx.ToolTip("Export InVesalius screen to a image file") | |
101 | + tooltip = wx.ToolTip(_("Export InVesalius screen to a image file")) | |
102 | 102 | link_export_picture = hl.HyperLinkCtrl(self, -1, |
103 | - "Export picture...") | |
103 | + _("Export picture...")) | |
104 | 104 | link_export_picture.SetUnderlines(False, False, False) |
105 | 105 | link_export_picture.SetColours("BLACK", "BLACK", "BLACK") |
106 | 106 | link_export_picture.SetToolTip(tooltip) |
... | ... | @@ -109,8 +109,8 @@ class InnerTaskPanel(wx.Panel): |
109 | 109 | link_export_picture.Bind(hl.EVT_HYPERLINK_LEFT, |
110 | 110 | self.OnLinkExportPicture) |
111 | 111 | |
112 | - tooltip = wx.ToolTip("Export 3D surface") | |
113 | - link_export_surface = hl.HyperLinkCtrl(self, -1,"Export 3D surface...") | |
112 | + tooltip = wx.ToolTip(_("Export 3D surface")) | |
113 | + link_export_surface = hl.HyperLinkCtrl(self, -1,_("Export 3D surface...")) | |
114 | 114 | link_export_surface.SetUnderlines(False, False, False) |
115 | 115 | link_export_surface.SetColours("BLACK", "BLACK", "BLACK") |
116 | 116 | link_export_surface.SetToolTip(tooltip) |
... | ... | @@ -119,8 +119,8 @@ class InnerTaskPanel(wx.Panel): |
119 | 119 | link_export_surface.Bind(hl.EVT_HYPERLINK_LEFT, |
120 | 120 | self.OnLinkExportSurface) |
121 | 121 | |
122 | - tooltip = wx.ToolTip("Export 3D mask (voxels)") | |
123 | - link_export_mask = hl.HyperLinkCtrl(self, -1,"Export mask...") | |
122 | + tooltip = wx.ToolTip(_("Export 3D mask (voxels)")) | |
123 | + link_export_mask = hl.HyperLinkCtrl(self, -1,_("Export mask...")) | |
124 | 124 | link_export_mask.SetUnderlines(False, False, False) |
125 | 125 | link_export_mask.SetColours("BLACK", "BLACK", "BLACK") |
126 | 126 | link_export_mask.SetToolTip(tooltip) |
... | ... | @@ -270,7 +270,7 @@ class InnerTaskPanel(wx.Panel): |
270 | 270 | |
271 | 271 | |
272 | 272 | dlg = wx.FileDialog(None, |
273 | - "Save 3D surface as...", # title | |
273 | + _("Save 3D surface as..."), # title | |
274 | 274 | "", # last used directory |
275 | 275 | project_name, # filename |
276 | 276 | WILDCARD_SAVE_3D, |
... | ... | @@ -289,9 +289,9 @@ class InnerTaskPanel(wx.Panel): |
289 | 289 | (filename, filetype)) |
290 | 290 | else: |
291 | 291 | dlg = wx.MessageDialog(None, |
292 | - "You need to create a surface and make it "+ | |
293 | - "visible before exporting it.", | |
294 | - 'InVesalius Information', | |
292 | + _("You need to create a surface and make it ") + | |
293 | + _("visible before exporting it."), | |
294 | + _('InVesalius Information'), | |
295 | 295 | wx.OK | wx.ICON_INFORMATION) |
296 | 296 | try: |
297 | 297 | dlg.ShowModal() | ... | ... |
invesalius/gui/task_importer.py
... | ... | @@ -61,8 +61,8 @@ class InnerTaskPanel(wx.Panel): |
61 | 61 | self.float_hyper_list = [] |
62 | 62 | |
63 | 63 | # Fixed hyperlink items |
64 | - tooltip = wx.ToolTip("Select DICOM or Analyze files to be reconstructed") | |
65 | - link_import_local = hl.HyperLinkCtrl(self, -1, "Import medical images...") | |
64 | + tooltip = wx.ToolTip(_("Select DICOM or Analyze files to be reconstructed")) | |
65 | + link_import_local = hl.HyperLinkCtrl(self, -1, _("Import medical images...")) | |
66 | 66 | link_import_local.SetUnderlines(False, False, False) |
67 | 67 | link_import_local.SetColours("BLACK", "BLACK", "BLACK") |
68 | 68 | link_import_local.SetToolTip(tooltip) |
... | ... | @@ -79,8 +79,8 @@ class InnerTaskPanel(wx.Panel): |
79 | 79 | #link_import_pacs.UpdateLink() |
80 | 80 | #link_import_pacs.Bind(hl.EVT_HYPERLINK_LEFT, self.OnLinkImportPACS) |
81 | 81 | |
82 | - tooltip = wx.ToolTip("Open an existing InVesalius project...") | |
83 | - link_open_proj = hl.HyperLinkCtrl(self,-1,"Open an existing project...") | |
82 | + tooltip = wx.ToolTip(_("Open an existing InVesalius project...")) | |
83 | + link_open_proj = hl.HyperLinkCtrl(self,-1,_("Open an existing project...")) | |
84 | 84 | link_open_proj.SetUnderlines(False, False, False) |
85 | 85 | link_open_proj.SetColours("BLACK", "BLACK", "BLACK") |
86 | 86 | link_open_proj.SetToolTip(tooltip) | ... | ... |
invesalius/gui/task_slice.py
... | ... | @@ -76,7 +76,7 @@ class InnerTaskPanel(wx.Panel): |
76 | 76 | |
77 | 77 | |
78 | 78 | # Fixed hyperlink items |
79 | - tooltip = wx.ToolTip("Create mask for slice segmentation and edition") | |
79 | + tooltip = wx.ToolTip(_("Create mask for slice segmentation and edition")) | |
80 | 80 | link_new_mask = hl.HyperLinkCtrl(self, -1, "Create new mask") |
81 | 81 | link_new_mask.SetUnderlines(False, False, False) |
82 | 82 | link_new_mask.SetColours("BLACK", "BLACK", "BLACK") |
... | ... | @@ -105,7 +105,7 @@ class InnerTaskPanel(wx.Panel): |
105 | 105 | self.fold_panel = fold_panel |
106 | 106 | |
107 | 107 | # Button to fold to select region task |
108 | - button_next = wx.Button(self, -1, "Create 3D surface") | |
108 | + button_next = wx.Button(self, -1, _("Create 3D surface")) | |
109 | 109 | if sys.platform != 'win32': |
110 | 110 | button_next.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) |
111 | 111 | button_next.Bind(wx.EVT_BUTTON, self.OnButtonNextTask) |
... | ... | @@ -134,8 +134,8 @@ class InnerTaskPanel(wx.Panel): |
134 | 134 | self.GetMaskSelected()) |
135 | 135 | |
136 | 136 | def OnLinkNewMask(self, evt=None): |
137 | - dlg = wx.TextEntryDialog(self, 'Name of new mask:', | |
138 | - 'InVesalius 3.0 - New mask') | |
137 | + dlg = wx.TextEntryDialog(self, _('Name of new mask:'), | |
138 | + _('InVesalius 3.0 - New mask')) | |
139 | 139 | dlg.CenterOnScreen() |
140 | 140 | default_mask_name = const.MASK_NAME_PATTERN %(mask.Mask.general_index+2) |
141 | 141 | dlg.SetValue(default_mask_name) |
... | ... | @@ -193,7 +193,7 @@ class InnerFoldPanel(wx.Panel): |
193 | 193 | style.SetSecondColour(default_colour) |
194 | 194 | |
195 | 195 | # Fold 1 - Mask properties |
196 | - item = fold_panel.AddFoldPanel("Mask properties", collapsed=True) | |
196 | + item = fold_panel.AddFoldPanel(_("Mask properties"), collapsed=True) | |
197 | 197 | self.mask_prop_panel = MaskProperties(item) |
198 | 198 | fold_panel.ApplyCaptionStyle(item, style) |
199 | 199 | fold_panel.AddFoldPanelWindow(item, self.mask_prop_panel, Spacing= 0, |
... | ... | @@ -201,7 +201,7 @@ class InnerFoldPanel(wx.Panel): |
201 | 201 | fold_panel.Expand(fold_panel.GetFoldPanel(0)) |
202 | 202 | |
203 | 203 | # Fold 2 - Advanced edition tools |
204 | - item = fold_panel.AddFoldPanel("Advanced edition tools", collapsed=True) | |
204 | + item = fold_panel.AddFoldPanel(_("Advanced edition tools"), collapsed=True) | |
205 | 205 | fold_panel.ApplyCaptionStyle(item, style) |
206 | 206 | fold_panel.AddFoldPanelWindow(item, EditionTools(item), Spacing= 0, |
207 | 207 | leftSpacing=0, rightSpacing=0) |
... | ... | @@ -285,7 +285,7 @@ class MaskProperties(wx.Panel): |
285 | 285 | |
286 | 286 | ## LINE 2 |
287 | 287 | text_thresh = wx.StaticText(self, -1, |
288 | - "Set predefined or manual threshold:") | |
288 | + _("Set predefined or manual threshold:")) | |
289 | 289 | |
290 | 290 | ## LINE 3 |
291 | 291 | combo_thresh = wx.ComboBox(self, -1, "", size=(15,-1), |
... | ... | @@ -437,17 +437,17 @@ class EditionTools(wx.Panel): |
437 | 437 | self.SetBackgroundColour(default_colour) |
438 | 438 | |
439 | 439 | ## LINE 1 |
440 | - text1 = wx.StaticText(self, -1, "Choose brush type, size or operation:") | |
440 | + text1 = wx.StaticText(self, -1, _("Choose brush type, size or operation:")) | |
441 | 441 | |
442 | 442 | ## LINE 2 |
443 | 443 | menu = wx.Menu() |
444 | 444 | |
445 | 445 | CIRCLE_BMP = wx.Bitmap("../icons/brush_circle.jpg", wx.BITMAP_TYPE_JPEG) |
446 | - item = wx.MenuItem(menu, MENU_BRUSH_CIRCLE, "Circle") | |
446 | + item = wx.MenuItem(menu, MENU_BRUSH_CIRCLE, _("Circle")) | |
447 | 447 | item.SetBitmap(CIRCLE_BMP) |
448 | 448 | |
449 | 449 | SQUARE_BMP = wx.Bitmap("../icons/brush_square.jpg", wx.BITMAP_TYPE_JPEG) |
450 | - item2 = wx.MenuItem(menu, MENU_BRUSH_SQUARE, "Square") | |
450 | + item2 = wx.MenuItem(menu, MENU_BRUSH_SQUARE, _("Square")) | |
451 | 451 | item2.SetBitmap(SQUARE_BMP) |
452 | 452 | |
453 | 453 | menu.AppendItem(item) |
... | ... | @@ -483,7 +483,7 @@ class EditionTools(wx.Panel): |
483 | 483 | line2.Add(combo_brush_op, 1, wx.EXPAND|wx.TOP|wx.RIGHT|wx.LEFT, 5) |
484 | 484 | |
485 | 485 | ## LINE 3 |
486 | - text_thresh = wx.StaticText(self, -1, "Brush threshold range:") | |
486 | + text_thresh = wx.StaticText(self, -1, _("Brush threshold range:")) | |
487 | 487 | |
488 | 488 | ## LINE 4 |
489 | 489 | gradient_thresh = grad.GradientSlider(self, -1, 0, 5000, 0, 5000, | ... | ... |
invesalius/gui/task_surface.py
... | ... | @@ -27,7 +27,7 @@ import wx.lib.pubsub as ps |
27 | 27 | import gui.widgets.foldpanelbar as fpb |
28 | 28 | |
29 | 29 | #INTERPOLATION_MODE_LIST = ["Cubic", "Linear", "NearestNeighbor"] |
30 | -QUALITY_LIST = ["Low", "Medium", "High", "Optimal *", "Custom"] | |
30 | +QUALITY_LIST = [_("Low"), _("Medium"), _("High"), _("Optimal *"), _("Custom")] | |
31 | 31 | SURFACE_LIST = [] |
32 | 32 | MASK_LIST = ["Mask 1"] |
33 | 33 | MIN_TRANSPARENCY = 0 |
... | ... | @@ -38,7 +38,7 @@ BTN_NEW = wx.NewId() |
38 | 38 | MENU_SQUARE = wx.NewId() |
39 | 39 | MENU_CIRCLE = wx.NewId() |
40 | 40 | |
41 | -OP_LIST = ["Draw", "Erase", "Threshold"] | |
41 | +OP_LIST = [_("Draw"), _("Erase"), _("Threshold")] | |
42 | 42 | |
43 | 43 | |
44 | 44 | class TaskPanel(wx.Panel): |
... | ... | @@ -80,7 +80,7 @@ class InnerTaskPanel(wx.Panel): |
80 | 80 | self.Bind(wx.EVT_BUTTON, self.OnButton) |
81 | 81 | |
82 | 82 | # Fixed hyperlink items |
83 | - tooltip = wx.ToolTip("Create 3D surface based on a mask") | |
83 | + tooltip = wx.ToolTip(_("Create 3D surface based on a mask")) | |
84 | 84 | link_new_surface = hl.HyperLinkCtrl(self, -1, "Create new 3D surface") |
85 | 85 | link_new_surface.SetUnderlines(False, False, False) |
86 | 86 | link_new_surface.SetColours("BLACK", "BLACK", "BLACK") |
... | ... | @@ -99,7 +99,7 @@ class InnerTaskPanel(wx.Panel): |
99 | 99 | fold_panel.SetBackgroundColour(default_colour) |
100 | 100 | |
101 | 101 | # Button to fold to select region task |
102 | - button_next = wx.Button(self, -1, "Next step") | |
102 | + button_next = wx.Button(self, -1, _("Next step")) | |
103 | 103 | if sys.platform != 'win32': |
104 | 104 | button_next.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) |
105 | 105 | #button_next.Bind(wx.EVT_BUTTON, self.OnButtonNextTask) |
... | ... | @@ -128,7 +128,7 @@ class InnerTaskPanel(wx.Panel): |
128 | 128 | evt.Skip() |
129 | 129 | |
130 | 130 | def OnLinkNewSurface(self, evt=None): |
131 | - dlg = NewSurfaceDialog(self, -1, 'InVesalius 3.0 - New surface') | |
131 | + dlg = NewSurfaceDialog(self, -1, _('InVesalius 3.0 - New surface')) | |
132 | 132 | if dlg.ShowModal() == wx.ID_OK: |
133 | 133 | print "TODO: Send Signal - Create 3d surface %s \n" % dlg.GetValue() |
134 | 134 | dlg.Destroy() |
... | ... | @@ -165,7 +165,7 @@ class NewSurfaceDialog(wx.Dialog): |
165 | 165 | # contents |
166 | 166 | |
167 | 167 | # Label related to mask name |
168 | - label_mask = wx.StaticText(self, -1, "Select mask to be used for creating 3D surface:") | |
168 | + label_mask = wx.StaticText(self, -1, _("Select mask to be used for creating 3D surface:")) | |
169 | 169 | |
170 | 170 | # Combo related to mask name |
171 | 171 | combo_surface_name = wx.ComboBox(self, -1, "", choices= MASK_LIST, |
... | ... | @@ -176,11 +176,11 @@ class NewSurfaceDialog(wx.Dialog): |
176 | 176 | self.combo_surface_name = combo_surface_name |
177 | 177 | |
178 | 178 | |
179 | - label_surface = wx.StaticText(self, -1, "Set new surface name:") | |
179 | + label_surface = wx.StaticText(self, -1, _("Set new surface name:")) | |
180 | 180 | |
181 | 181 | text = wx.TextCtrl(self, -1, "", size=(80,-1)) |
182 | - text.SetHelpText("Name the new surface to be created") | |
183 | - text.SetValue("Default 3D") | |
182 | + text.SetHelpText(_("Name the new surface to be created")) | |
183 | + text.SetValue(_("Default 3D")) | |
184 | 184 | self.text = text |
185 | 185 | |
186 | 186 | sizer = wx.BoxSizer(wx.VERTICAL) |
... | ... | @@ -209,7 +209,7 @@ class NewSurfaceDialog(wx.Dialog): |
209 | 209 | sizer.Fit(self) |
210 | 210 | |
211 | 211 | def GetValue(self): |
212 | - return self.text.GetValue() +"| mask: "+ MASK_LIST[self.combo_surface_name.GetSelection()] | |
212 | + return self.text.GetValue() + _("| mask: ") + MASK_LIST[self.combo_surface_name.GetSelection()] | |
213 | 213 | |
214 | 214 | class FoldPanel(wx.Panel): |
215 | 215 | def __init__(self, parent): |
... | ... | @@ -248,14 +248,14 @@ class InnerFoldPanel(wx.Panel): |
248 | 248 | style.SetSecondColour(default_colour) |
249 | 249 | |
250 | 250 | # Fold 1 - Surface properties |
251 | - item = fold_panel.AddFoldPanel("Surface properties", collapsed=True) | |
251 | + item = fold_panel.AddFoldPanel(_("Surface properties"), collapsed=True) | |
252 | 252 | fold_panel.ApplyCaptionStyle(item, style) |
253 | 253 | fold_panel.AddFoldPanelWindow(item, SurfaceProperties(item), Spacing= 0, |
254 | 254 | leftSpacing=0, rightSpacing=0) |
255 | 255 | fold_panel.Expand(fold_panel.GetFoldPanel(0)) |
256 | 256 | |
257 | 257 | # Fold 2 - Surface quality |
258 | - item = fold_panel.AddFoldPanel("Surface quality", collapsed=True) | |
258 | + item = fold_panel.AddFoldPanel(_("Surface quality"), collapsed=True) | |
259 | 259 | fold_panel.ApplyCaptionStyle(item, style) |
260 | 260 | fold_panel.AddFoldPanelWindow(item, QualityAdjustment(item), Spacing= 0, |
261 | 261 | leftSpacing=0, rightSpacing=0) |
... | ... | @@ -300,7 +300,7 @@ class SurfaceProperties(wx.Panel): |
300 | 300 | |
301 | 301 | ## LINE 2 |
302 | 302 | |
303 | - text_transparency = wx.StaticText(self, -1, "Transparency:") | |
303 | + text_transparency = wx.StaticText(self, -1, _("Transparency:")) | |
304 | 304 | |
305 | 305 | slider_transparency = wx.Slider(self, -1, 0, MIN_TRANSPARENCY, |
306 | 306 | MAX_TRANSPARENCY, |
... | ... | @@ -402,7 +402,7 @@ class QualityAdjustment(wx.Panel): |
402 | 402 | # LINE 2 |
403 | 403 | check_decimate = wx.CheckBox(self, -1, "") |
404 | 404 | |
405 | - text_decimate = wx.StaticText(self, -1, "Decimate resolution:") | |
405 | + text_decimate = wx.StaticText(self, -1, _("Decimate resolution:")) | |
406 | 406 | |
407 | 407 | spin_decimate = wx.SpinCtrl(self, -1, "", (30, 50)) |
408 | 408 | spin_decimate.SetRange(1,100) |
... | ... | @@ -412,7 +412,7 @@ class QualityAdjustment(wx.Panel): |
412 | 412 | # LINE 3 |
413 | 413 | check_smooth = wx.CheckBox(self, -1, "") |
414 | 414 | |
415 | - text_smooth = wx.StaticText(self, -1, "Smooth iterations:") | |
415 | + text_smooth = wx.StaticText(self, -1, _("Smooth iterations:")) | |
416 | 416 | |
417 | 417 | spin_smooth = wx.SpinCtrl(self, -1, "", (30, 50)) |
418 | 418 | spin_smooth.SetRange(1,100) | ... | ... |
invesalius/gui/task_tools.py
... | ... | @@ -54,12 +54,12 @@ class InnerTaskPanel(wx.Panel): |
54 | 54 | self.float_hyper_list = [] |
55 | 55 | |
56 | 56 | # Fixed text and hyperlink items |
57 | - tooltip = wx.ToolTip("Measure distances") | |
58 | - txt_measure = wx.StaticText(self, -1, "Measure") | |
57 | + tooltip = wx.ToolTip(_("Measure distances")) | |
58 | + txt_measure = wx.StaticText(self, -1, _("Measure")) | |
59 | 59 | txt_measure.SetToolTip(tooltip) |
60 | 60 | |
61 | - tooltip = wx.ToolTip("Add text annotations") | |
62 | - txt_annotation = hl.HyperLinkCtrl(self, -1,"Add text annotations") | |
61 | + tooltip = wx.ToolTip(_("Add text annotations")) | |
62 | + txt_annotation = hl.HyperLinkCtrl(self, -1,_("Add text annotations")) | |
63 | 63 | txt_annotation.SetUnderlines(False, False, False) |
64 | 64 | txt_annotation.SetColours("BLACK", "BLACK", "BLACK") |
65 | 65 | txt_annotation.SetToolTip(tooltip) | ... | ... |
invesalius/gui/widgets/slice_menu.py
... | ... | @@ -36,19 +36,19 @@ class SliceMenu(wx.Menu): |
36 | 36 | #Window and level from DICOM |
37 | 37 | new_id = wx.NewId() |
38 | 38 | wl_item = wx.MenuItem(submenu_wl, new_id,\ |
39 | - 'Default', kind=wx.ITEM_RADIO) | |
39 | + _('Default'), kind=wx.ITEM_RADIO) | |
40 | 40 | submenu_wl.AppendItem(wl_item) |
41 | 41 | self.ID_TO_TOOL_ITEM[new_id] = wl_item |
42 | 42 | |
43 | 43 | #Case the user change window and level |
44 | 44 | new_id = self.other_wl_id = wx.NewId() |
45 | 45 | wl_item = wx.MenuItem(submenu_wl, new_id,\ |
46 | - 'Manual', kind=wx.ITEM_RADIO) | |
46 | + _('Manual'), kind=wx.ITEM_RADIO) | |
47 | 47 | submenu_wl.AppendItem(wl_item) |
48 | 48 | self.ID_TO_TOOL_ITEM[new_id] = wl_item |
49 | 49 | |
50 | 50 | for name in sorted(const.WINDOW_LEVEL): |
51 | - if not(name == 'Default' or name == 'Manual'): | |
51 | + if not(name == _('Default') or name == _('Manual')): | |
52 | 52 | new_id = wx.NewId() |
53 | 53 | wl_item = wx.MenuItem(submenu_wl, new_id,\ |
54 | 54 | name, kind=wx.ITEM_RADIO) |
... | ... | @@ -58,8 +58,8 @@ class SliceMenu(wx.Menu): |
58 | 58 | |
59 | 59 | #----------- Sub menu of the save and load options --------- |
60 | 60 | submenu_wl.AppendSeparator() |
61 | - options = ["Save current values", | |
62 | - "Save current values as...","Load values"] | |
61 | + options = [_("Save current values"), | |
62 | + _("Save current values as..."),_("Load values")] | |
63 | 63 | |
64 | 64 | for name in options: |
65 | 65 | new_id = wx.NewId() |
... | ... | @@ -72,12 +72,12 @@ class SliceMenu(wx.Menu): |
72 | 72 | submenu_pseudo_colours = wx.Menu() |
73 | 73 | new_id = wx.NewId() |
74 | 74 | color_item = wx.MenuItem(submenu_pseudo_colours, new_id,\ |
75 | - 'Default ', kind=wx.ITEM_RADIO) | |
75 | + _("Default "), kind=wx.ITEM_RADIO) | |
76 | 76 | submenu_pseudo_colours.AppendItem(color_item) |
77 | 77 | self.ID_TO_TOOL_ITEM[new_id] = color_item |
78 | 78 | |
79 | 79 | for name in sorted(const.SLICE_COLOR_TABLE): |
80 | - if not(name == 'Default '): | |
80 | + if not(name == _("Default ")): | |
81 | 81 | new_id = wx.NewId() |
82 | 82 | color_item = wx.MenuItem(submenu_wl, new_id,\ |
83 | 83 | name, kind=wx.ITEM_RADIO) |
... | ... | @@ -96,9 +96,9 @@ class SliceMenu(wx.Menu): |
96 | 96 | |
97 | 97 | |
98 | 98 | # Add sub itens in the menu |
99 | - self.AppendMenu(-1, "Window Width and Level", submenu_wl) | |
100 | - self.AppendMenu(-1, "Pseudo Colour", submenu_pseudo_colours) | |
101 | - self.AppendMenu(-1, "Image Tiling", submenu_image_tiling) | |
99 | + self.AppendMenu(-1, _("Window Width and Level"), submenu_wl) | |
100 | + self.AppendMenu(-1, _("Pseudo Colour"), submenu_pseudo_colours) | |
101 | + self.AppendMenu(-1, _("Image Tiling"), submenu_image_tiling) | |
102 | 102 | |
103 | 103 | # It doesn't work in Linux |
104 | 104 | self.Bind(wx.EVT_MENU, self.OnPopup) | ... | ... |