* [RFA] Add _() to query
@ 2009-02-24 10:52 teawater
2009-02-24 14:33 ` Daniel Jacobowitz
2009-02-24 19:46 ` Eli Zaretskii
0 siblings, 2 replies; 7+ messages in thread
From: teawater @ 2009-02-24 10:52 UTC (permalink / raw)
To: Eli Zaretskii, gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1246 bytes --]
Hi Eli,
I remember you told me that you want to add _() to all query.
I make a patch for it. Do you think it's OK?
2009-02-24 Hui Zhu <teawater@gmail.com>
* cli/cli-script.c (define_command): Add _() to query.
* gnu-nat.c (inf_validate_task_sc): Ditto.
* infcmd.c (kill_if_already_running): Ditto.
(jump_command): Ditto.
(attach_command): Ditto.
* inflow.c (kill_command): Ditto.
* infrun.c (handle_command): Ditto.
* maint.c (maintenance_dump_me): Ditto.
* memattr.c (mem_delete_command): Ditto.
* monitor.c (monitor_interrupt_query): Ditto.
* nto-procfs.c (interrupt_query): Ditto.
* printcmd.c (undisplay_command): Ditto.
* remote-mips.c (mips_kill): Ditto.
* remote.c (interrupt_query): Ditto.
* solib-irix.c (irix_open_symbol_file_object): Ditto.
* solib-osf.c (osf_open_symbol_file_object): Ditto.
* solib-pa64.c (pa64_open_symbol_file_object): Ditto.
* solib-som.c (som_open_symbol_file_object): Ditto.
* solib-svr4.c (open_symbol_file_object): Ditto.
* symfile.c (symbol_file_add_with_addrs_or_offsets): Ditto.
(add_symbol_file_command): Ditto.
* target.c (kill_or_be_killed): Ditto.
* tracepoint.c (delete_trace_command): Ditto.
* top.c (quit_confirm): Add _() to s that will be used
in query.
Thanks,
Hui
[-- Attachment #2: add__()_to_query.txt --]
[-- Type: text/plain, Size: 10326 bytes --]
---
cli/cli-script.c | 2 +-
gnu-nat.c | 4 ++--
infcmd.c | 10 +++++-----
inflow.c | 2 +-
infrun.c | 4 ++--
maint.c | 2 +-
memattr.c | 2 +-
monitor.c | 4 ++--
nto-procfs.c | 4 ++--
printcmd.c | 2 +-
remote-mips.c | 4 ++--
remote.c | 4 ++--
solib-irix.c | 2 +-
solib-osf.c | 2 +-
solib-pa64.c | 2 +-
solib-som.c | 2 +-
solib-svr4.c | 2 +-
symfile.c | 4 ++--
target.c | 2 +-
top.c | 6 +++---
tracepoint.c | 2 +-
21 files changed, 34 insertions(+), 34 deletions(-)
--- a/cli/cli-script.c
+++ b/cli/cli-script.c
@@ -1379,7 +1379,7 @@ define_command (char *comname, int from_
{
warning (_("Your new `%s' command does not hook any existing command."),
comfull);
- if (!query ("Proceed? "))
+ if (!query (_("Proceed? ")))
error (_("Not confirmed."));
}
}
--- a/gnu-nat.c
+++ b/gnu-nat.c
@@ -854,8 +854,8 @@ inf_validate_task_sc (struct inf *inf)
int abort;
target_terminal_ours (); /* Allow I/O. */
- abort = !query ("Pid %d has an additional task suspend count of %d;"
- " clear it? ", inf->pid,
+ abort = !query (_("Pid %d has an additional task suspend count of %d;"
+ " clear it? "), inf->pid,
suspend_count - inf->task->cur_sc);
target_terminal_inferior (); /* Give it back to the child. */
--- a/infcmd.c
+++ b/infcmd.c
@@ -441,8 +441,8 @@ kill_if_already_running (int from_tty)
target_require_runnable ();
if (from_tty
- && !query ("The program being debugged has been started already.\n\
-Start it from the beginning? "))
+ && !query (_("The program being debugged has been started already.\n\
+Start it from the beginning? ")))
error (_("Program not restarted."));
target_kill ();
}
@@ -1029,7 +1029,7 @@ jump_command (char *arg, int from_tty)
sfn = find_pc_function (sal.pc);
if (fn != NULL && sfn != fn)
{
- if (!query ("Line %d is not in `%s'. Jump anyway? ", sal.line,
+ if (!query (_("Line %d is not in `%s'. Jump anyway? "), sal.line,
SYMBOL_PRINT_NAME (fn)))
{
error (_("Not confirmed."));
@@ -1043,7 +1043,7 @@ jump_command (char *arg, int from_tty)
if (section_is_overlay (SYMBOL_OBJ_SECTION (sfn)) &&
!section_is_mapped (SYMBOL_OBJ_SECTION (sfn)))
{
- if (!query ("WARNING!!! Destination is in unmapped overlay! Jump anyway? "))
+ if (!query (_("WARNING!!! Destination is in unmapped overlay! Jump anyway? ")))
{
error (_("Not confirmed."));
/* NOTREACHED */
@@ -2235,7 +2235,7 @@ attach_command (char *args, int from_tty
;
else if (target_has_execution)
{
- if (query ("A program is being debugged already. Kill it? "))
+ if (query (_("A program is being debugged already. Kill it? ")))
target_kill ();
else
error (_("Not killed."));
--- a/inflow.c
+++ b/inflow.c
@@ -607,7 +607,7 @@ kill_command (char *arg, int from_tty)
if (ptid_equal (inferior_ptid, null_ptid))
error (_("The program is not being run."));
- if (!query ("Kill the program being debugged? "))
+ if (!query (_("Kill the program being debugged? ")))
error (_("Not confirmed."));
target_kill ();
--- a/infrun.c
+++ b/infrun.c
@@ -4637,8 +4637,8 @@ handle_command (char *args, int from_tty
case TARGET_SIGNAL_INT:
if (!allsigs && !sigs[signum])
{
- if (query ("%s is used by the debugger.\n\
-Are you sure you want to change it? ", target_signal_to_name ((enum target_signal) signum)))
+ if (query (_("%s is used by the debugger.\n\
+Are you sure you want to change it? "), target_signal_to_name ((enum target_signal) signum)))
{
sigs[signum] = 1;
}
--- a/maint.c
+++ b/maint.c
@@ -98,7 +98,7 @@ maintenance_command (char *args, int fro
static void
maintenance_dump_me (char *args, int from_tty)
{
- if (query ("Should GDB dump core? "))
+ if (query (_("Should GDB dump core? ")))
{
#ifdef __DJGPP__
/* SIGQUIT by default is ignored, so use SIGABRT instead. */
--- a/memattr.c
+++ b/memattr.c
@@ -690,7 +690,7 @@ mem_delete_command (char *args, int from
if (p == 0)
{
- if (query ("Delete all memory regions? "))
+ if (query (_("Delete all memory regions? ")))
mem_clear ();
dont_repeat ();
return;
--- a/monitor.c
+++ b/monitor.c
@@ -1008,8 +1008,8 @@ monitor_interrupt_query (void)
{
target_terminal_ours ();
- if (query ("Interrupted while waiting for the program.\n\
-Give up (and stop debugging it)? "))
+ if (query (_("Interrupted while waiting for the program.\n\
+Give up (and stop debugging it)? ")))
{
target_mourn_inferior ();
deprecated_throw_reason (RETURN_QUIT);
--- a/nto-procfs.c
+++ b/nto-procfs.c
@@ -593,8 +593,8 @@ interrupt_query (void)
{
target_terminal_ours ();
- if (query ("Interrupted while waiting for the program.\n\
-Give up (and stop debugging it)? "))
+ if (query (_("Interrupted while waiting for the program.\n\
+Give up (and stop debugging it)? ")))
{
target_mourn_inferior ();
deprecated_throw_reason (RETURN_QUIT);
--- a/printcmd.c
+++ b/printcmd.c
@@ -1482,7 +1482,7 @@ undisplay_command (char *args, int from_
if (args == 0)
{
- if (query ("Delete all auto-display expressions? "))
+ if (query (_("Delete all auto-display expressions? ")))
clear_displays ();
dont_repeat ();
return;
--- a/remote-mips.c
+++ b/remote-mips.c
@@ -2142,8 +2142,8 @@ mips_kill (void)
target_terminal_ours ();
- if (query ("Interrupted while waiting for the program.\n\
-Give up (and stop debugging it)? "))
+ if (query (_("Interrupted while waiting for the program.\n\
+Give up (and stop debugging it)? ")))
{
/* Clean up in such a way that mips_close won't try to talk to the
board (it almost surely won't work since we weren't able to talk to
--- a/remote.c
+++ b/remote.c
@@ -3944,8 +3944,8 @@ interrupt_query (void)
}
else
{
- if (query ("Interrupted while waiting for the program.\n\
-Give up (and stop debugging it)? "))
+ if (query (_("Interrupted while waiting for the program.\n\
+Give up (and stop debugging it)? ")))
{
pop_target ();
deprecated_throw_reason (RETURN_QUIT);
--- a/solib-irix.c
+++ b/solib-irix.c
@@ -611,7 +611,7 @@ irix_open_symbol_file_object (void *from
char *filename;
if (symfile_objfile)
- if (!query ("Attempt to reload symbols from process? "))
+ if (!query (_("Attempt to reload symbols from process? ")))
return 0;
if ((debug_base = locate_base ()) == 0)
--- a/solib-osf.c
+++ b/solib-osf.c
@@ -584,7 +584,7 @@ osf_open_symbol_file_object (void *from_
int found;
if (symfile_objfile)
- if (!query ("Attempt to reload symbols from process? "))
+ if (!query (_("Attempt to reload symbols from process? ")))
return 0;
/* The first module after /sbin/loader is the main program. */
--- a/solib-pa64.c
+++ b/solib-pa64.c
@@ -529,7 +529,7 @@ pa64_open_symbol_file_object (void *from
char *dll_path;
if (symfile_objfile)
- if (!query ("Attempt to reload symbols from process? "))
+ if (!query (_("Attempt to reload symbols from process? ")))
return 0;
/* Read in the load map pointer if we have not done so already. */
--- a/solib-som.c
+++ b/solib-som.c
@@ -696,7 +696,7 @@ som_open_symbol_file_object (void *from_
char buf[4];
if (symfile_objfile)
- if (!query ("Attempt to reload symbols from process? "))
+ if (!query (_("Attempt to reload symbols from process? ")))
return 0;
/* First link map member should be the executable. */
--- a/solib-svr4.c
+++ b/solib-svr4.c
@@ -845,7 +845,7 @@ open_symbol_file_object (void *from_ttyp
struct cleanup *cleanups = make_cleanup (xfree, l_name_buf);
if (symfile_objfile)
- if (!query ("Attempt to reload symbols from process? "))
+ if (!query (_("Attempt to reload symbols from process? ")))
return 0;
/* Always locate the debug struct, in case it has moved. */
--- a/symfile.c
+++ b/symfile.c
@@ -968,7 +968,7 @@ symbol_file_add_with_addrs_or_offsets (b
if ((have_full_symbols () || have_partial_symbols ())
&& mainline
&& from_tty
- && !query ("Load new symbol table from \"%s\"? ", name))
+ && !query (_("Load new symbol table from \"%s\"? "), name))
error (_("Not confirmed."));
objfile = allocate_objfile (abfd, flags);
@@ -2222,7 +2222,7 @@ add_symbol_file_command (char *args, int
so we can't determine what section names are valid. */
}
- if (from_tty && (!query ("%s", "")))
+ if (from_tty && (!query (_("%s"), "")))
error (_("Not confirmed."));
symbol_file_add (filename, from_tty, section_addrs, 0, flags);
--- a/target.c
+++ b/target.c
@@ -341,7 +341,7 @@ kill_or_be_killed (int from_tty)
{
printf_unfiltered (_("You are already running a program:\n"));
target_files_info ();
- if (query ("Kill it? "))
+ if (query (_("Kill it? ")))
{
target_kill ();
if (target_has_execution)
--- a/top.c
+++ b/top.c
@@ -1183,11 +1183,11 @@ quit_confirm (void)
see if a GUI is running. The `use_windows' variable doesn't
cut it. */
if (deprecated_init_ui_hook)
- s = "A debugging session is active.\nDo you still want to close the debugger?";
+ s = _("A debugging session is active.\nDo you still want to close the debugger?");
else if (inf->attach_flag)
- s = "The program is running. Quit anyway (and detach it)? ";
+ s = _("The program is running. Quit anyway (and detach it)? ");
else
- s = "The program is running. Quit anyway (and kill it)? ";
+ s = _("The program is running. Quit anyway (and kill it)? ");
if (!query ("%s", s))
return 0;
--- a/tracepoint.c
+++ b/tracepoint.c
@@ -692,7 +692,7 @@ delete_trace_command (char *args, int fr
if (from_tty) /* confirm only if from_tty... */
if (tracepoint_chain) /* and if there are tracepoints to
delete! */
- if (!query ("Delete all tracepoints? "))
+ if (!query (_("Delete all tracepoints? ")))
return;
map_args_over_tracepoints (args, from_tty, delete_op);
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFA] Add _() to query
2009-02-24 10:52 [RFA] Add _() to query teawater
@ 2009-02-24 14:33 ` Daniel Jacobowitz
2009-02-24 14:38 ` Jan Kratochvil
2009-02-24 19:46 ` Eli Zaretskii
1 sibling, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2009-02-24 14:33 UTC (permalink / raw)
To: teawater; +Cc: Eli Zaretskii, gdb-patches
On Tue, Feb 24, 2009 at 03:10:51PM +0800, teawater wrote:
> Hi Eli,
>
> I remember you told me that you want to add _() to all query.
> I make a patch for it. Do you think it's OK?
Before this goes in, could someone see if we could use xgettext
--keyword instead? That would let us translate messages in
one place instead of all over.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Add _() to query
2009-02-24 14:33 ` Daniel Jacobowitz
@ 2009-02-24 14:38 ` Jan Kratochvil
2009-02-24 14:57 ` Daniel Jacobowitz
0 siblings, 1 reply; 7+ messages in thread
From: Jan Kratochvil @ 2009-02-24 14:38 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: teawater, Eli Zaretskii, gdb-patches
On Tue, 24 Feb 2009 14:32:55 +0100, Daniel Jacobowitz wrote:
> On Tue, Feb 24, 2009 at 03:10:51PM +0800, teawater wrote:
> > I remember you told me that you want to add _() to all query.
> > I make a patch for it. Do you think it's OK?
>
> Before this goes in, could someone see if we could use xgettext
> --keyword instead? That would let us translate messages in
> one place instead of all over.
The standard for localized messages is _(). Making the localization more
magic makes the GDB project less viable for possible development newcomers.
Regards,
Jan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Add _() to query
2009-02-24 14:38 ` Jan Kratochvil
@ 2009-02-24 14:57 ` Daniel Jacobowitz
2009-02-24 15:32 ` Jan Kratochvil
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2009-02-24 14:57 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: teawater, Eli Zaretskii, gdb-patches
On Tue, Feb 24, 2009 at 02:39:29PM +0100, Jan Kratochvil wrote:
> On Tue, 24 Feb 2009 14:32:55 +0100, Daniel Jacobowitz wrote:
> > On Tue, Feb 24, 2009 at 03:10:51PM +0800, teawater wrote:
> > > I remember you told me that you want to add _() to all query.
> > > I make a patch for it. Do you think it's OK?
> >
> > Before this goes in, could someone see if we could use xgettext
> > --keyword instead? That would let us translate messages in
> > one place instead of all over.
>
> The standard for localized messages is _(). Making the localization more
> magic makes the GDB project less viable for possible development newcomers.
I have trouble believing that.
I got this idea from GCC, which has used it for as long as I can
remember. If you pass --keyword=query, and use N_() inside the body
of query, xgettext will localize all arguments to query in the entire
program.
This is better for code size and for readability.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Add _() to query
2009-02-24 14:57 ` Daniel Jacobowitz
@ 2009-02-24 15:32 ` Jan Kratochvil
0 siblings, 0 replies; 7+ messages in thread
From: Jan Kratochvil @ 2009-02-24 15:32 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: teawater, Eli Zaretskii, gdb-patches
On Tue, 24 Feb 2009 15:48:26 +0100, Daniel Jacobowitz wrote:
> On Tue, Feb 24, 2009 at 02:39:29PM +0100, Jan Kratochvil wrote:
> > The standard for localized messages is _(). Making the localization more
> > magic makes the GDB project less viable for possible development newcomers.
>
> I have trouble believing that.
>
> I got this idea from GCC, which has used it for as long as I can
> remember. If you pass --keyword=query, and use N_() inside the body
^^^^ -> _() or gettext()
> of query, xgettext will localize all arguments to query in the entire
> program.
>
> This is better for code size and for readability.
OK, understood but still I disagree with --keyword=query when considering its
pros and cons.
Thanks,
Jan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Add _() to query
2009-02-24 10:52 [RFA] Add _() to query teawater
2009-02-24 14:33 ` Daniel Jacobowitz
@ 2009-02-24 19:46 ` Eli Zaretskii
2009-02-25 7:18 ` teawater
1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2009-02-24 19:46 UTC (permalink / raw)
To: teawater; +Cc: gdb-patches
> Date: Tue, 24 Feb 2009 15:10:51 +0800
> From: teawater <teawater@gmail.com>
>
> Hi Eli,
>
> I remember you told me that you want to add _() to all query.
> I make a patch for it. Do you think it's OK?
Yes, with the exception of a single comment below.
(I don't have an opinion regarding the _() vs --keyword approach to
marking translatable strings.)
> - if (from_tty && (!query ("%s", "")))
> + if (from_tty && (!query (_("%s"), "")))
AFAIK, it is absolutely pointless to mark for translation strings that
have no text, just formatted output conversion spec. That's because
the only translation of such strings is the string itself.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFA] Add _() to query
2009-02-24 19:46 ` Eli Zaretskii
@ 2009-02-25 7:18 ` teawater
0 siblings, 0 replies; 7+ messages in thread
From: teawater @ 2009-02-25 7:18 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Wed, Feb 25, 2009 at 02:52, Eli Zaretskii <eliz@gnu.org> wrote:
>> Date: Tue, 24 Feb 2009 15:10:51 +0800
>> From: teawater <teawater@gmail.com>
>>
>> Hi Eli,
>>
>> I remember you told me that you want to add _() to all query.
>> I make a patch for it. Do you think it's OK?
>
> Yes, with the exception of a single comment below.
>
> (I don't have an opinion regarding the _() vs --keyword approach to
> marking translatable strings.)
>
>> - if (from_tty && (!query ("%s", "")))
>> + if (from_tty && (!query (_("%s"), "")))
>
> AFAIK, it is absolutely pointless to mark for translation strings that
> have no text, just formatted output conversion spec. That's because
> the only translation of such strings is the string itself.
>
Thanks Eli, I have removed this line and checked patch in.
Hui
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-02-25 2:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-24 10:52 [RFA] Add _() to query teawater
2009-02-24 14:33 ` Daniel Jacobowitz
2009-02-24 14:38 ` Jan Kratochvil
2009-02-24 14:57 ` Daniel Jacobowitz
2009-02-24 15:32 ` Jan Kratochvil
2009-02-24 19:46 ` Eli Zaretskii
2009-02-25 7:18 ` teawater
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox