From 8f9cff284876311a0517ecf191f7b1eaf769cf0a Mon Sep 17 00:00:00 2001 From: martijn Date: Tue, 26 Aug 2014 11:10:43 +0200 Subject: [PATCH] Added dutch language, fixed other languages not loading bug and replaced two instances of hard coded english with i18n.translate --- gooey/gooey_decorator.py | 13 +++++++------ gooey/gui/advanced_config.py | 5 +++-- gooey/languages/dutch.json | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/gooey/gooey_decorator.py b/gooey/gooey_decorator.py index 793a35d..426689a 100644 --- a/gooey/gooey_decorator.py +++ b/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) diff --git a/gooey/gui/advanced_config.py b/gooey/gui/advanced_config.py index cf4e2eb..c4bb4a1 100644 --- a/gooey/gui/advanced_config.py +++ b/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) diff --git a/gooey/languages/dutch.json b/gooey/languages/dutch.json index 8e4dadb..1fe108f 100644 --- a/gooey/languages/dutch.json +++ b/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",