From 7404084962b5f4b0cf76b6a7775382a5846f8fc1 Mon Sep 17 00:00:00 2001 From: martijn Date: Sun, 24 Aug 2014 17:53:18 +0200 Subject: [PATCH 1/2] added Dutch language json --- gooey/languages/dutch.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 gooey/languages/dutch.json diff --git a/gooey/languages/dutch.json b/gooey/languages/dutch.json new file mode 100644 index 0000000..8e4dadb --- /dev/null +++ b/gooey/languages/dutch.json @@ -0,0 +1,20 @@ +{ + "cancel": "Annuleren", + "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", + "finished_title": "Klaar", + "optional_args_msg": "Optionele Argumenten", + "required_args_msg": "Verplichte Argumenten", + "running_msg": "Wacht alstublieft totdat het programma klaar is met draaien,dit kan even duren", + "running_title": "Bezig", + "settings_title": "Opties", + "simple_config": "Voer Command Line argumenten in", + "start": "Start", + "status": "Status", + "success_message": "Programma is succesvol voltooid!\nDruk op de OK knop om af te sluiten", + "sure_you_want_to_exit": "Weet je zeker dat je wilt afsluiten?", + "uh_oh": "\nUh oh! Er is iets misgegaan. \nKopieƫr de te error hieronder om de ontwikkelaar te laten weten wat er mis is gegaan.\n\n{} \t\t\n\t\t" +} \ No newline at end of file From 8f9cff284876311a0517ecf191f7b1eaf769cf0a Mon Sep 17 00:00:00 2001 From: martijn Date: Tue, 26 Aug 2014 11:10:43 +0200 Subject: [PATCH 2/2] 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",