Browse Source

closes #256 - missing i18n strings

pull/473/head
Chris 6 years ago
parent
commit
97929ea034
5 changed files with 9 additions and 6 deletions
  1. 2
      gooey/gui/components/footer.py
  2. 4
      gooey/gui/components/widgets/core/chooser.py
  3. 4
      gooey/gui/components/widgets/dialogs/calender_dialog.py
  4. 2
      gooey/gui/lang/i18n.py
  5. 3
      gooey/languages/english.json

2
gooey/gui/components/footer.py

@ -123,7 +123,7 @@ class Footer(wx.Panel):
parent=self,
id=event_id,
size=(90, 24),
label=i18n._(label),
label=label,
style=style)
def dispatch_click(self, event):

4
gooey/gui/components/widgets/core/chooser.py

@ -63,13 +63,13 @@ class Chooser(wx.Panel):
class FileChooser(Chooser):
""" Retrieve an existing file from the system """
def getDialog(self):
return wx.FileDialog(self, style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
return wx.FileDialog(self, _('open_file'), style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
class MultiFileChooser(Chooser):
""" Retrieve an multiple files from the system """
def getDialog(self):
return wx.FileDialog(self, "Open Files" ,style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE)
return wx.FileDialog(self, _('open_files'), style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE)
def getResult(self, dialog):
return os.pathsep.join(dialog.GetPaths())

4
gooey/gui/components/widgets/dialogs/calender_dialog.py

@ -15,12 +15,12 @@ class CalendarDlg(wx.Dialog):
self.SetBackgroundColour('#ffffff')
self.ok_button = wx.Button(self, wx.ID_OK, label=_('Ok'))
self.ok_button = wx.Button(self, wx.ID_OK, label=_('ok'))
self.datepicker = Classes.DatePickerCtrl(self, style=Constants.WX_DP_DROPDOWN)
vertical_container = wx.BoxSizer(wx.VERTICAL)
vertical_container.AddSpacer(10)
vertical_container.Add(wx_util.h1(self, label=_('Select a Date')), 0, wx.LEFT | wx.RIGHT, 15)
vertical_container.Add(wx_util.h1(self, label=_('select_date')), 0, wx.LEFT | wx.RIGHT, 15)
vertical_container.AddSpacer(10)
vertical_container.Add(self.datepicker, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 15)

2
gooey/gui/lang/i18n.py

@ -28,7 +28,7 @@ def load(language_dir, filename, encoding):
'listed language directory'.format(filename.title(), language_dir))
def translate(key):
return _DICTIONARY.get(key, key)
return _DICTIONARY.get(key, '(Translate me!) {}'.format(key))
def _(key):
return translate(key)

3
gooey/languages/english.json

@ -16,12 +16,15 @@
"finished_forced_quit": "Terminated by user",
"finished_msg": "All done! You may now safely close the program.",
"finished_title": "Finished",
"ok": "Ok",
"open_file": "Open File",
"open_files": "Open Files",
"optional_args_msg": "Optional Arguments",
"required_args_msg": "Required Arguments",
"restart": "Restart",
"running_msg": "Please wait while the application performs its tasks. \nThis may take a few moments",
"running_title": "Running",
"select_date": "Select a Date",
"select_option": "Select Option",
"settings_title": "Settings",
"simple_config": "Enter Command Line Arguments",

Loading…
Cancel
Save