an i18n sample

Eli Zaretskii eliz@gnu.org
Mon Oct 25 20:10:00 GMT 2004


> Date: Sun, 24 Oct 2004 16:18:02 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr>,
> 	gdb-patches@sources.redhat.com
> 
> I agree about partial translations, of course.  In this particular
> case, it looks like the file needs type_sprint or type_to_string.

It is generally bad to produce strings in parts, because that prevents
the translator from seing the full sentence or at least a full phrase.
So I think type_sprint etc. will not solve the problem I was worried
about.

> > >    if (TYPE_LENGTH (type) <= 0)
> > >      {
> > > -      warning ("Invalid type size for `%s' detected: %d.",
> > > -               TYPE_NAME (rtype) ? TYPE_NAME (rtype) : "<unnamed>",
> > > +      warning (_("Invalid type size for `%s' detected: %d."),
> > > +               TYPE_NAME (rtype) ? TYPE_NAME (rtype) : _("<unnamed>"),
> > >                 TYPE_LENGTH (type));
> > >      }
> > 
> > Same here.
> 
> Actually, I disagree about this one.  Whether or not "<unnamed>"
> should be translated, is there any reason not to translate the format
> string?

That's not what I meant.  I wanted to see something like this:

    if (TYPE_LENGTH (type) <= 0)
      {
        if (TYPE_NAME (rtype))
           warning (_("Invalid type size for `%s' detected: %d."),
                    TYPE_NAME (rtype), TYPE_LENGTH (type));
        else
           warning (_("Invalid type size for <unnamed> detected: %d."),
                    TYPE_LENGTH (type));
      }

> That said, the "when" is a partial sentence, and the \n%*s doesn't
> need to be translated.

That's a very partial sentence, so it needs to be made a full sentence
along the same lines as above.



More information about the Gdb-patches mailing list