I've noticed that there is a wide range of output string formatting
throughout GRASS. Should we standardize on how text in formatted for
various situations (warnings, errors, etc)?
For instance, I've seen mapsets displayed in '', '<>', or no
separation at all from the rest of the text.
Also, I see that text may begin capitalized or lower case and may or may
not end with punctuation.
As has been noted before by ESR and others, modules should be quiet by
default (I am a violator, but correcting).
Too bad we don't have a PSC. **nudge**
--
Brad Douglas <rez touchofmadness com> KB8UYR
Address: 37.493,-121.924 / WGS84 National Map Corps #TNMC-3785
I've noticed that there is a wide range of output string formatting
throughout GRASS. Should we standardize on how text in formatted for
various situations (warnings, errors, etc)?
For instance, I've seen mapsets displayed in '', '<>', or no
separation at all from the rest of the text.
Also, I see that text may begin capitalized or lower case and may or
may not end with punctuation.
I fully agree.
For i18n reasons mostly I have taken to copying strings from other
modules rather than reinvent my own when doing something new or
i18n'zing a module.
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"
jachym
On Wed, Jul 19, 2006 at 07:50:45PM +1200, Hamish wrote:
Brad wrote:
> I've noticed that there is a wide range of output string formatting
> throughout GRASS. Should we standardize on how text in formatted for
> various situations (warnings, errors, etc)?
>
> For instance, I've seen mapsets displayed in '', '<>', or no
> separation at all from the rest of the text.
>
> Also, I see that text may begin capitalized or lower case and may or
> may not end with punctuation.
I fully agree.
For i18n reasons mostly I have taken to copying strings from other
modules rather than reinvent my own when doing something new or
i18n'zing a module.
On Wed, Jul 19, 2006 at 10:24:54AM +0200, Jachym Cepicky 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]"
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"
jupp, thanks for pointing this out. I vote for this to standardize!
Cheers
Stephan
On Wed, Jul 19, 2006 at 07:50:45PM +1200, Hamish wrote:
> Brad wrote:
> > I've noticed that there is a wide range of output string
> > formatting throughout GRASS. Should we standardize on how text
> > in formatted for various situations (warnings, errors, etc)?
> >
> > For instance, I've seen mapsets displayed in '', '<>', or no
> > separation at all from the rest of the text.
> >
> > Also, I see that text may begin capitalized or lower case and may
> > or may not end with punctuation.
>
> I fully agree.
>
> For i18n reasons mostly I have taken to copying strings from other
> modules rather than reinvent my own when doing something new or
> i18n'zing a module.
>
> e.g.
>
> raster$ grep -rI -A5 G_open_raster_new * | grep fatal | cut -f2-
> -d'('
>
> and then pick my favorite:
> _("Unable to create raster map <%s>")
>
>
> same issue with italicized module names and bolded option
> convensions used in the help pages.
>
>
> Hamish
>
> _______________________________________________
> grass-dev mailing list
> grass-dev@grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass-dev
> 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).