[GRASS-dev] String standardization

Glynn Clements glynn at gclements.plus.com
Thu Jul 20 02:07:26 EDT 2006


Markus Neteler wrote:

> > I raise my hand for all translators! 
> > 
> >  cat grassmods_cs.po|grep open|grep raster
> >  msgid "Cannot open raster map"
> >  msgid "error opening raster map [%s]."
> >  msgid "Unable to open raster map [%s]"
> >  msgid "Unable to open raster map [%s] in [%s]"
> >  msgid "Unable to open raster map [%s]."
> >  msgid "%s: %s - Unable to open the input raster map\n"
> >  msgid "Cannot open raster map [%s]"
> >  msgid "Unable to open raster map <%s>"
> >  msgid "<%s> unable to open raster file"
> >  msgid "%s - can't open raster file"
> >  msgid "Can't open raster file %s"
> >  msgid "Cannot open terrain raster map <%s@%s>!"
> >  msgid "Cannot open raster file [%s]!"
> >  msgid "can't open raster file [%s] needed for input coordinates"
> >  msgid "%s - can't open raster map"
> 
> We should probably come up with message macros for standard
> messages like 
>  MSG_RASTER_NOT_FOUND_IN_MAPSET - "Unable to open raster map [%s] in [%s]"
> 
> or so. But I don't know how that's done in C.

The easiest way to simplify this particular situation is to move the
error message into G_open_cell_old() etc.

Beyond that, I would guess that the vast majority of modules will just
call G_fatal_error() if a map cannot be opened. In which case,
G_open_cell_old() etc should probably just call G_fatal_error(),
relieving individual modules of the burden. Separate "_noerror"
versions can be provided for modules which really need to handle
this issue themselves.

Also, it would be useful if G_parser() would ensure the existence of
input maps, the way it ensures the non-existence of output maps. That
would ensure that failure occurs at an early stage, rather than after
the module has started to create output maps, temporary files etc. 
However, there would need to be a way to bypass this check, for use by
modules which need to read maps from another location (e.g. *.proj).

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list