From patchwork Fri Aug 2 14:15:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33920 Received: (qmail 113345 invoked by alias); 2 Aug 2019 14:15:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 112577 invoked by uid 89); 2 Aug 2019 14:15:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=catalog, outermost, sk:set_cmd, H*Ad:U*tromey X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Aug 2019 14:15:23 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id EEBE45608B; Fri, 2 Aug 2019 10:15:21 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id K900Oiqwfp+G; Fri, 2 Aug 2019 10:15:21 -0400 (EDT) Received: from murgatroyd.Home (97-122-178-82.hlrn.qwest.net [97.122.178.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 9ACC956078; Fri, 2 Aug 2019 10:15:21 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Use _() in calls to build_help Date: Fri, 2 Aug 2019 08:15:19 -0600 Message-Id: <20190802141519.20019-1-tromey@adacore.com> MIME-Version: 1.0 Currently some code in gdb uses build_help with N_(), like: static const std::string compile_print_help = gdb::option::build_help (N_("\ I believe this is incorrect. The N_ macro is used to mark text that should end up in the message catalog, but which will be translated by a later call to gettext. However, in this case, there is no later call to gettext, so (if gdb had translations), this text would remain untranslated. Instead, I think using the ordinary _() macro is correct here. Translators will have to know to preserve "%OPTIONS%" in the text -- but that seems both unavoidable and fine. Tested by rebuilding as there's not much else to do. gdb/ChangeLog 2019-08-02 Tom Tromey * compile/compile.c (_initialize_compile): Use _(), not N_(). * thread.c (_initialize_thread): Use _(), not N_(). * stack.c (_initialize_stack): Use _(), not N_(). * printcmd.c (_initialize_printcmd): Use _(), not N_(). --- gdb/ChangeLog | 7 +++++++ gdb/compile/compile.c | 6 +++--- gdb/printcmd.c | 2 +- gdb/stack.c | 8 ++++---- gdb/thread.c | 4 ++-- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c index 4c0721daa67..1c0513ae97e 100644 --- a/gdb/compile/compile.c +++ b/gdb/compile/compile.c @@ -971,7 +971,7 @@ Command to compile source code and inject it into the inferior."), const auto compile_opts = make_compile_options_def_group (nullptr); static const std::string compile_code_help - = gdb::option::build_help (N_("\ + = gdb::option::build_help (_("\ Compile, inject, and execute code.\n\ \n\ Usage: compile code [OPTION]... [CODE]\n\ @@ -994,7 +994,7 @@ indicate the end of the expression."), set_cmd_completer_handle_brkchars (c, compile_code_command_completer); static const std::string compile_file_help - = gdb::option::build_help (N_("\ + = gdb::option::build_help (_("\ Evaluate a file containing source code.\n\ \n\ Usage: compile file [OPTION].. [FILENAME]\n\ @@ -1011,7 +1011,7 @@ Options:\n\ const auto compile_print_opts = make_value_print_options_def_group (nullptr); static const std::string compile_print_help - = gdb::option::build_help (N_("\ + = gdb::option::build_help (_("\ Evaluate EXPR by using the compiler and print result.\n\ \n\ Usage: compile print [[OPTION]... --] [/FMT] [EXPR]\n\ diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 1faa09eee71..0c368a6f6d8 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -2848,7 +2848,7 @@ This may usually be abbreviated to simply \"set\"."), const auto print_opts = make_value_print_options_def_group (nullptr); - static const std::string print_help = gdb::option::build_help (N_("\ + static const std::string print_help = gdb::option::build_help (_("\ Print value of expression EXP.\n\ Usage: print [[OPTION]... --] [/FMT] [EXP]\n\ \n\ diff --git a/gdb/stack.c b/gdb/stack.c index 7833ca4aeb6..0dd7057fe1f 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -3275,7 +3275,7 @@ Options:\n\ const auto frame_apply_opts = make_frame_apply_options_def_group (nullptr, nullptr); - static std::string frame_apply_cmd_help = gdb::option::build_help (N_("\ + static std::string frame_apply_cmd_help = gdb::option::build_help (_("\ Apply a command to a number of frames.\n\ Usage: frame apply COUNT [OPTION]... COMMAND\n\ With a negative COUNT argument, applies the command on outermost -COUNT frames.\n" @@ -3288,7 +3288,7 @@ With a negative COUNT argument, applies the command on outermost -COUNT frames.\ &frame_cmd_list); set_cmd_completer_handle_brkchars (cmd, frame_apply_cmd_completer); - static std::string frame_apply_all_cmd_help = gdb::option::build_help (N_("\ + static std::string frame_apply_all_cmd_help = gdb::option::build_help (_("\ Apply a command to all frames.\n\ \n\ Usage: frame apply all [OPTION]... COMMAND\n" @@ -3300,7 +3300,7 @@ Usage: frame apply all [OPTION]... COMMAND\n" &frame_apply_cmd_list); set_cmd_completer_handle_brkchars (cmd, frame_apply_all_cmd_completer); - static std::string frame_apply_level_cmd_help = gdb::option::build_help (N_("\ + static std::string frame_apply_level_cmd_help = gdb::option::build_help (_("\ Apply a command to a list of frames.\n\ \n\ Usage: frame apply level LEVEL... [OPTION]... COMMAND\n\ @@ -3407,7 +3407,7 @@ Usage: select-frame level LEVEL"), = make_backtrace_options_def_group (nullptr, nullptr, nullptr); static std::string backtrace_help - = gdb::option::build_help (N_("\ + = gdb::option::build_help (_("\ Print backtrace of all stack frames, or innermost COUNT frames.\n\ Usage: backtrace [OPTION]... [QUALIFIER]... [COUNT | -COUNT]\n\ \n\ diff --git a/gdb/thread.c b/gdb/thread.c index 485c996e146..4a7fe689dbb 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -2150,7 +2150,7 @@ Options:\n\ const auto thread_apply_opts = make_thread_apply_options_def_group (nullptr); - static std::string thread_apply_help = gdb::option::build_help (N_("\ + static std::string thread_apply_help = gdb::option::build_help (_("\ Apply a command to a list of threads.\n\ Usage: thread apply ID... [OPTION]... COMMAND\n\ ID is a space-separated list of IDs of threads to apply COMMAND on.\n" @@ -2166,7 +2166,7 @@ THREAD_APPLY_OPTION_HELP), const auto thread_apply_all_opts = make_thread_apply_all_options_def_group (nullptr, nullptr); - static std::string thread_apply_all_help = gdb::option::build_help (N_("\ + static std::string thread_apply_all_help = gdb::option::build_help (_("\ Apply a command to all threads.\n\ \n\ Usage: thread apply all [OPTION]... COMMAND\n"