diff --git a/gooey/gui/controller.py b/gooey/gui/controller.py index f25156e..fbd32f4 100644 --- a/gooey/gui/controller.py +++ b/gooey/gui/controller.py @@ -32,8 +32,8 @@ class Controller(object): self.build_spec = build_spec def OnCancelButton(self, widget, event): - msg = i18n.translate('sure_you_want_to_exit') - dlg = wx.MessageDialog(None, msg, i18n.translate('close_program'), wx.YES_NO) + msg = i18n._('sure_you_want_to_exit') + dlg = wx.MessageDialog(None, msg, i18n._('close_program'), wx.YES_NO) result = dlg.ShowModal() if result == YES: dlg.Destroy() @@ -47,7 +47,7 @@ class Controller(object): if not self.build_spec['manual_start']: _required = self.core_gui.GetRequiredArgs() if _required and any(req == '' for req in _required): - self.ShowDialog(i18n.translate('error_title'), "Must fill in all fields in the Required section!", wx.ICON_ERROR) + self.ShowDialog(i18n._('error_title'), "Must fill in all fields in the Required section!", wx.ICON_ERROR) return command = '{0} {1}'.format(self.build_spec['target'], cmd_line_args) @@ -86,13 +86,13 @@ class Controller(object): sys.exit() def ShowGoodFinishedDialog(self): - self.ShowDialog(i18n.translate("execution_finished"), - i18n.translate('success_message'), + self.ShowDialog(i18n._("execution_finished"), + i18n._('success_message'), wx.ICON_INFORMATION) def ShowBadFinishedDialog(self, error_msg): - msg = i18n.translate('uh_oh').format(error_msg) - self.ShowDialog(i18n.translate('error_title'), msg, wx.ICON_ERROR) + msg = i18n._('uh_oh').format(error_msg) + self.ShowDialog(i18n._('error_title'), msg, wx.ICON_ERROR) def ShowDialog(self, title, content, style): diff --git a/gooey/gui/windows/advanced_config.py b/gooey/gui/windows/advanced_config.py index 0a2287c..d90710e 100644 --- a/gooey/gui/windows/advanced_config.py +++ b/gooey/gui/windows/advanced_config.py @@ -46,7 +46,7 @@ class AdvancedConfigPanel(ScrolledPanel, OptionReader): container.AddSpacer(15) if self.widgets.required_args: - container.Add(wx_util.h1(self, i18n.translate("required_args_msg")), 0, wx.LEFT | wx.RIGHT, PADDING) + container.Add(wx_util.h1(self, i18n._("required_args_msg")), 0, wx.LEFT | wx.RIGHT, PADDING) container.AddSpacer(5) container.Add(wx_util.horizontal_rule(self), *STD_LAYOUT) container.AddSpacer(20) @@ -58,7 +58,7 @@ class AdvancedConfigPanel(ScrolledPanel, OptionReader): if self.widgets.optional_args: container.AddSpacer(10) - container.Add(wx_util.h1(self, i18n.translate("optional_args_msg")), 0, wx.LEFT | wx.RIGHT, PADDING) + container.Add(wx_util.h1(self, i18n._("optional_args_msg")), 0, wx.LEFT | wx.RIGHT, PADDING) container.AddSpacer(5) container.Add(wx_util.horizontal_rule(self), *STD_LAYOUT) container.AddSpacer(20) diff --git a/gooey/gui/windows/base_window.py b/gooey/gui/windows/base_window.py index 151f7b4..fd9753d 100644 --- a/gooey/gui/windows/base_window.py +++ b/gooey/gui/windows/base_window.py @@ -51,7 +51,7 @@ class BaseWindow(wx.Frame): # init gui _desc = self.build_spec['program_description'] self.head_panel = header.FrameHeader( - heading=i18n.translate("settings_title"), + heading=i18n._("settings_title"), subheading=_desc or '', parent=self) self.config_panel = AdvancedConfigPanel(self, self.build_spec) diff --git a/gooey/gui/windows/footer.py b/gooey/gui/windows/footer.py index fd4e1e0..6074cd8 100644 --- a/gooey/gui/windows/footer.py +++ b/gooey/gui/windows/footer.py @@ -43,10 +43,10 @@ class AbstractFooter(wx.Panel): Refactor image tools into their own module. The resize code is getting spread around a bit. ''' - self.cancel_button = self._Button(i18n.translate('cancel'), wx.ID_CANCEL) - self.start_button = self._Button(i18n.translate('start'), wx.ID_OK) + self.cancel_button = self._Button(i18n._('cancel'), wx.ID_CANCEL) + self.start_button = self._Button(i18n._('start'), wx.ID_OK) self.running_animation = wx.animate.GIFAnimationCtrl(self, -1, image_repository.loader) - self.close_button = self._Button(i18n.translate("close"), wx.ID_OK) + self.close_button = self._Button(i18n._("close"), wx.ID_OK) self.stop_button = self._Button('Stop', wx.ID_OK) # TODO: i18n self.restart_button = self._Button('Restart', wx.ID_OK) # TODO: i18n diff --git a/gooey/gui/windows/header.py b/gooey/gui/windows/header.py index 4229419..7dd0c87 100644 --- a/gooey/gui/windows/header.py +++ b/gooey/gui/windows/header.py @@ -79,16 +79,16 @@ class FrameHeader(wx.Panel): def _init_pages(self): def PageOne(): - self._header.SetLabel(i18n.translate("running_title")) - self._subheader.SetLabel(i18n.translate('running_msg')) + self._header.SetLabel(i18n._("running_title")) + self._subheader.SetLabel(i18n._('running_msg')) self._check_mark.Hide() self._settings_img.Hide() self._running_img.Show() self.Layout() def PageTwo(): - self._header.SetLabel(i18n.translate('finished_title')) - self._subheader.SetLabel(i18n.translate('finished_msg')) + self._header.SetLabel(i18n._('finished_title')) + self._subheader.SetLabel(i18n._('finished_msg')) self._running_img.Hide() self._check_mark.Show() self.Layout() diff --git a/gooey/gui/windows/runtime_display_panel.py b/gooey/gui/windows/runtime_display_panel.py index c70e026..6335a46 100644 --- a/gooey/gui/windows/runtime_display_panel.py +++ b/gooey/gui/windows/runtime_display_panel.py @@ -35,7 +35,7 @@ class RuntimeDisplay(wx.Panel): self.SetBackgroundColour('#F0F0F0') def _init_components(self): - self.text = wx.StaticText(self, label=i18n.translate("status")) + self.text = wx.StaticText(self, label=i18n._("status")) self.cmd_textbox = wx.TextCtrl( self, -1, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH)