[GRASS-dev] lib/gis/*.c: Extra calls to sprintf () just before G_warning ()

Maris Nartiss maris.gis at gmail.com
Mon Mar 23 07:05:20 EDT 2009


Hello Ivan,
It's good to see Your internationalisation efforts, still I spotted
one huge NO-NO in Your patch - one should NEVER split strings marked
for translation. Some languages may require opposite word order in
sentence or even different sentence for each case. Also if translating
such sentences is possible, it's hard, as it's not possible to see
whole sentence just it's start or end.

Also if somebody is taking internationalisation in GRASS serious, he
needs to add context to more complex strings. More about making
programs internationalisation-friendly is possible to read in gettext
manual [1].

WBR,
Maris.

1.  http://www.gnu.org/software/gettext/manual/gettext.html#Sources

2009/3/22, Ivan Shmakov <oneingray at gmail.com>:
> 	    sprintf(tail, _(" It is a reclass of raster map <%s@%s> "),
> 		    real_name, real_mapset);
> 	    tail = buf + strlen(buf);
> 	    if (!G_find_cell(real_name, real_mapset))
> 		sprintf(tail, _("which is missing."));
> 	    else
> 		sprintf(tail, _("whose header file can't be opened."));

> ===================================================================
> --- lib/gis/get_cellhd.c	(revision 36445)
> +++ lib/gis/get_cellhd.c	(working copy)
> @@ -77,7 +77,7 @@
>  		sprintf(tail, _("which is missing."));
>  	    else
>  		sprintf(tail, _("whose header file can't be opened."));
> -	    G_warning(buf);
> +	    G_warning ("%s", buf);


More information about the grass-dev mailing list