From 4ef1496a45f3f2e7cf46dcb68a0bc57abfbdb159 Mon Sep 17 00:00:00 2001 From: Krzysztof Jurewicz Date: Wed, 15 Apr 2020 13:25:00 +0200 Subject: [PATCH] Do not translate arguments in add_subparsers add_subparsers is typically called before Gooey initialization, when translations are not loaded. --- gooey/python_bindings/gooey_parser.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gooey/python_bindings/gooey_parser.py b/gooey/python_bindings/gooey_parser.py index 8524603..a99a214 100644 --- a/gooey/python_bindings/gooey_parser.py +++ b/gooey/python_bindings/gooey_parser.py @@ -2,8 +2,6 @@ from argparse import ArgumentParser, _SubParsersAction from argparse import _MutuallyExclusiveGroup, _ArgumentGroup from textwrap import dedent -from gooey.gui.lang.i18n import _ - class GooeySubParser(_SubParsersAction): def __init__(self, *args, **kwargs): @@ -134,8 +132,8 @@ class GooeyParser(object): kwargs.setdefault('parser_class', type(self)) if 'title' in kwargs or 'description' in kwargs: - title = _(kwargs.pop('title', 'subcommands')) - description = _(kwargs.pop('description', None)) + title = kwargs.pop('title', 'subcommands') + description = kwargs.pop('description', None) self._subparsers = self.add_argument_group(title, description) else: self._subparsers = self._positionals