[orca] Mark two additional argparse strings for translation
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Mark two additional argparse strings for translation
- Date: Fri, 26 Jun 2015 17:46:51 +0000 (UTC)
commit cfeb9a1754b3fdd6cd9a0c875fdb5ea191dfc5a0
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Jun 26 13:45:12 2015 -0400
Mark two additional argparse strings for translation
src/orca/messages.py | 9 +++++++++
src/orca/orca_bin.py.in | 8 ++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/messages.py b/src/orca/messages.py
index 328ae77..0aceebf 100644
--- a/src/orca/messages.py
+++ b/src/orca/messages.py
@@ -192,6 +192,15 @@ CLI_ENABLE_OPTION = _("Force use of option")
# using the '-e, --enable' or '-d, --disable' command line options.
CLI_OPTION = _("OPTION")
+# Translators: This string appears when using 'Orca -h' at the command line.
+# It serves as a sort of title and is followed by a detailed list of Orca's
+# optional command-line arguments.
+CLI_OPTIONAL_ARGUMENTS = _("Optional arguments")
+
+# Translators: This string appears when using 'Orca -h' at the command line.
+# It is followed by a brief list of Orca's optional command-line arguments.
+CLI_USAGE = _("Usage: ")
+
# Translators: This message is displayed when the user starts Orca from the
# command line and includes an invalid option or argument. After the message,
# the list of invalid items, as typed by the user, is displayed.
diff --git a/src/orca/orca_bin.py.in b/src/orca/orca_bin.py.in
index 2991f4b..f8c86f9 100644
--- a/src/orca/orca_bin.py.in
+++ b/src/orca/orca_bin.py.in
@@ -81,8 +81,10 @@ class HelpFormatter(argparse.HelpFormatter):
def __init__(self, prog, indent_increment=2, max_help_position=32,
width=None):
- super(HelpFormatter, self).__init__(
- prog, indent_increment, max_help_position, width)
+ super().__init__(prog, indent_increment, max_help_position, width)
+
+ def add_usage(self, usage, actions, groups, prefix=None):
+ super().add_usage(usage, actions, groups, messages.CLI_USAGE)
class Parser(argparse.ArgumentParser):
def __init__(self, *args, **kwargs):
@@ -119,6 +121,8 @@ class Parser(argparse.ArgumentParser):
self.add_argument(
"--debug", action="store_true", help=messages.CLI_ENABLE_DEBUG)
+ self._optionals.title = messages.CLI_OPTIONAL_ARGUMENTS
+
def parse_known_args(self, *args, **kwargs):
opts, invalid = super(Parser, self).parse_known_args(*args, **kwargs)
try:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]