This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: i18n, part 2


> Date: Sat, 4 Dec 2004 22:54:04 +0100
> From: Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr>
> 
> Hmm, it did the last time I tried it, but 0.14.1-6 seems to work as
> expected. I modified the patch.

Thanks.  My comments are below.

> BTW, is there an argument reformatting function in emacs, so that, say,
> M-q would wrap the arguments and strings up to fill-column?

Not that I know of, but you might have better success asking this on
emacs-devel@gnu.org.

> @@ -1700,16 +1700,16 @@ aix_thread_extra_thread_info (struct thr
>    status = pthdb_pthread_suspendstate (pd_session, pdtid, 
>  				       &suspendstate);
>    if (status == PTHDB_SUCCESS && suspendstate == PSS_SUSPENDED)
> -    fprintf_unfiltered (buf, ", suspended");
> +    fprintf_unfiltered (buf, _(", suspended"));
>  
>    status = pthdb_pthread_detachstate (pd_session, pdtid, 
>  				      &detachstate);
>    if (status == PTHDB_SUCCESS && detachstate == PDS_DETACHED)
> -    fprintf_unfiltered (buf, ", detached");
> +    fprintf_unfiltered (buf, _(", detached"));
>  
>    pthdb_pthread_cancelpend (pd_session, pdtid, &cancelpend);
>    if (status == PTHDB_SUCCESS && cancelpend)
> -    fprintf_unfiltered (buf, ", cancel pending");
> +    fprintf_unfiltered (buf, _(", cancel pending"));
>  
>    ui_file_write (buf, "", 1);

We discussed cases like this before, I believe.  The original code
fragment looks like this:

  if (tid != PTHDB_INVALID_TID)
    fprintf_unfiltered (buf, "tid %d", tid);

  status = pthdb_pthread_state (pd_session, pdtid, &state);
  if (status != PTHDB_SUCCESS)
    state = PST_NOTSUP;
  fprintf_unfiltered (buf, ", %s", state2str (state));

  status = pthdb_pthread_suspendstate (pd_session, pdtid, 
				       &suspendstate);
  if (status == PTHDB_SUCCESS && suspendstate == PSS_SUSPENDED)
    fprintf_unfiltered (buf, ", suspended");

  status = pthdb_pthread_detachstate (pd_session, pdtid, 
				      &detachstate);
  if (status == PTHDB_SUCCESS && detachstate == PDS_DETACHED)
    fprintf_unfiltered (buf, ", detached");

  pthdb_pthread_cancelpend (pd_session, pdtid, &cancelpend);
  if (status == PTHDB_SUCCESS && cancelpend)
    fprintf_unfiltered (buf, ", cancel pending");

  ui_file_write (buf, "", 1);

This code produces a complete sentence one word at a time, which I
think is bad for translating.  I think the code needs to be rewritten
to have full sentences like these:

     "tid %d, %s, suspended, detached, cancel pending"
     "tid %d, %s, detached, cancel pending"
     "tid %d, %s, cancel pending"
     "tid %d, %s"
     "tid %d, %s, suspended, cancel pending"
     "tid %d, %s, suspended, detached"
     "tid %d, %s, detached, cancel pending"
     "tid %d, %s, detached"

etc.  That makes the code less clever, but the translation is much
easier.  As the code is now, it will be almost impossible to get right
in some languages.

> -	      error ("Illegal update to pc in instruction");
> +	      error (_("Illegal update to pc in instruction"));

Perhaps we should take this opportunity to change "Illegal" to
"Invalid" here (and elsewhere in your patch), to follow the GNU coding
standards.

Otherwise, okay; thanks.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]