Browse Source

Added dutch language, fixed other languages not loading bug and replaced two instances of hard coded english with i18n.translate

pull/17/head
martijn 10 years ago
parent
commit
8f9cff2848
3 changed files with 12 additions and 10 deletions
  1. 13
      gooey/gooey_decorator.py
  2. 5
      gooey/gui/advanced_config.py
  3. 4
      gooey/languages/dutch.json

13
gooey/gooey_decorator.py

@ -11,12 +11,6 @@ from gooey.gui.component_factory import ComponentFactory
import i18n_config
import source_parser
from gooey.gui.client_app import ClientApp
from gooey.gui.client_app import EmptyClientApp
from gooey.gui.base_window import BaseWindow
from gooey.gui.advanced_config import AdvancedConfigPanel
from gooey.gui.basic_config_panel import BasicConfigPanel
def Gooey(f=None, advanced=True,
language='english', config=True,
@ -41,6 +35,13 @@ def Gooey(f=None, advanced=True,
load_language_pack(language)
# load gui components after loading the language pack
from gooey.gui.client_app import ClientApp
from gooey.gui.client_app import EmptyClientApp
from gooey.gui.base_window import BaseWindow
from gooey.gui.advanced_config import AdvancedConfigPanel
from gooey.gui.basic_config_panel import BasicConfigPanel
if config:
parser = get_parser(module_path)
client_app = ClientApp(parser, payload)

5
gooey/gui/advanced_config.py

@ -7,6 +7,7 @@ Created on Dec 28, 2013
import wx
from wx.lib.scrolledpanel import ScrolledPanel
from gooey import i18n
from gooey.gui.component_factory import ComponentFactory
from gooey.gui.option_reader import OptionReader
import styling
@ -39,9 +40,9 @@ class AdvancedConfigPanel(ScrolledPanel, OptionReader):
def _init_components(self):
self._msg_req_args = (styling.H1(self, "Required Arguments")
self._msg_req_args = (styling.H1(self, i18n.translate("required_args_msg"))
if self._positionals else None)
self._msg_opt_args = styling.H1(self, "Optional Arguments")
self._msg_opt_args = styling.H1(self, i18n.translate("optional_args_msg"))
def _do_layout(self):
STD_LAYOUT = (0, wx.LEFT | wx.RIGHT | wx.EXPAND, PADDING)

4
gooey/languages/dutch.json

@ -3,8 +3,8 @@
"close": "Sluiten",
"close_program": "Programma sluiten?",
"error_title": "Error",
"execution_finished": "Programma uitvoering is klaar",
"finished_msg": "Alles is klaar,je kunt het programma nu afsluiten",
"execution_finished": "Uitvoering is klaar",
"finished_msg": "Alles is klaar, je kunt het programma nu veilig afsluiten",
"finished_title": "Klaar",
"optional_args_msg": "Optionele Argumenten",
"required_args_msg": "Verplichte Argumenten",

Loading…
Cancel
Save