Let's squeeze that i18n bug!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Could this be related to this bug that I found in GTk+ in November. 

 Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@xxxxxxxxxx>

 * gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
 If translation does not include a '/', use entire
 translation instead of crashing.

(That was after GTK+ 1.2.6 was released.)


    From: Owen Taylor <otaylor@xxxxxxxxxx>
    To: Tor Lillqvist <tml@xxxxxx>
    Cc: timj@xxxxxxx
    Subject: Re: gtk_item_factory_parse_path() problem with incorrect translations
    Date: 16 Nov 1999 10:30:51 -0500


    Tor Lillqvist <tml@xxxxxx> writes:

    > Hi,
    > 
    > There is a problem with gtk_item_factory_parse_path() if it encounters
    > a bogus translation string (typically one of those fuzzy translations
    > I assume the gettext tools generate as more or less pathetic
    > guesstimates by themselves?). If the translation doesn't contain any

    Hmmm, but fuzzy matches are disabled by default until someone hand-edits
    them in...

    > slash, the code at the end of gtk_item_factory_parse_path() obviously
    > will crash.  This can be demonstrated by running the GIMP with
    > LANG=ru, for instance.
    > 
    > It might be argued that translations are supposed to be correct, and
    > that crashing is thus OK? Anyway, suggested fix below.

    Hmmm, sort of embarassing. I've been saying for a long time that
    the translations do _not_ need to contain the full path, since
    everything but the last component is simply ignored.

    So, the change that makes it do what I thought it was doing is:

    Index: gtkitemfactory.c
    ===================================================================
    RCS file: /cvs/gnome/gtk+/gtk/gtkitemfactory.c,v
    retrieving revision 1.21.2.5
    retrieving revision 1.21.2.6
    diff -u -r1.21.2.5 -r1.21.2.6
    --- gtkitemfactory.c	1999/10/07 21:29:41	1.21.2.5
    +++ gtkitemfactory.c	1999/11/16 15:25:48	1.21.2.6
    @@ -968,7 +968,10 @@
	 translation = str;

       p = strrchr (translation, '/');
    -  p++;
    +  if (p)
    +    p++;
    +  else
    +    p = translation;

       *item = g_strdup (p);

    Thanks for pointing this out,
					    Owen





[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux