[GRASS5] Re: Automatic gettextizations ; tables and g.html2man

Daniel Calvelo Aros dcalvelo at minag.gob.pe
Sun Mar 6 21:33:14 EST 2005


[Hamish]
> There is probably 500 different versions of "Failed to load map <$MAP>"
> which could all be the same..
> 
> To complicate matters, for easier debugging I have sometimes made
> several identical error messages within a module slightly different.
> That way when it fails one can quickly search to where in the code it
> failed without all dumping all sorts of debug info out all the time.
> e.g. <map> vs [map] or 'single' vs "double" quotes in error.
> (I think I did this in r.*.mat for example)

Mmmmh... Would it make sense to have a G_debug macro/function (in gis.h? not
sure...) to help in that? I was thinking of something like providing

#define G_debug(msg)\
#ifdef DEBUG\
fprintf(stderr,"[%s:%s] ",__FILE__, __LINE__);\
#ifdef __GNUC__\
fprintf(stderr,"in %s : ", __FUNCTION__);\
#endif\
fprintf(stderr, ##msg );\
#endif

That would enable:

1) to locate precisely those debug messages and not worry about them in
translations

2) to not type all those 'fprintf's :)

BTW such a macro could be extended to support verbose modes and so on.

> (e.g. r.in.mat, "Please contact the GRASS development team")
> 
> I suppose the translation effort is more important than subtle
> debugging tricks. Mentioned so you are aware this sort of thing exists.

Thanks for the tip. Another annoyance in translations is several lines of
fprintfs instead of one multiline string. That's quite uncomfortable when
editing po-files. I'll look into it, it must be detectable automatically.

Daniel.




More information about the grass-dev mailing list