Hi,
if I may make a suggestion on the message translation:
On Mon, Jun 2, 2014 at 4:14 PM, <svn_grass@osgeo.org> wrote:
Author: hcho
Date: 2014-06-02 07:14:16 -0700 (Mon, 02 Jun 2014)
New Revision: 60669
Modified:
grass/trunk/vector/v.vol.rst/dataoct.c
grass/trunk/vector/v.vol.rst/main.c
grass/trunk/vector/v.vol.rst/user1.c
grass/trunk/vector/v.vol.rst/user2.c
grass/trunk/vector/v.vol.rst/user3.c
grass/trunk/vector/v.vol.rst/vector.c
Log:
v.vol.rst: translate error/warning messages
All these messages need now to be translated separately (translator "hell" :):
- G_fatal_error("Not enough memory for az");
+ G_fatal_error(_("Not enough memory for az"));
adx = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!adx)
- G_fatal_error("Not enough memory for adx");
+ G_fatal_error(_("Not enough memory for adx"));
ady = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!ady)
- G_fatal_error("Not enough memory for ady");
+ G_fatal_error(_("Not enough memory for ady"));
adxx = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!adxx)
[...]
A better way may be (needs to be properly declared, just as example)
G_fatal_error(_("Not enough memory for %s"), mapname);
This reduces the work to one string and the rest comes in dynamically.
Furthermore it would be good to sync the messages to v.surf.rst to
make them as identical as possible.
Some best practice is described here:
https://trac.osgeo.org/grass/wiki/MessageStandardization
(which I now liked at
http://grasswiki.osgeo.org/wiki/GRASS_messages_translation)
Best
Markus
Those links are good reads. Less hell for translators, and more typing for developers. I’m on both sides.
···
On Mon, Jun 2, 2014 at 10:24 AM, Markus Neteler <neteler@osgeo.org> wrote:
Hi,
if I may make a suggestion on the message translation:
On Mon, Jun 2, 2014 at 4:14 PM, <svn_grass@osgeo.org> wrote:
Author: hcho
Date: 2014-06-02 07:14:16 -0700 (Mon, 02 Jun 2014)
New Revision: 60669
Modified:
grass/trunk/vector/v.vol.rst/dataoct.c
grass/trunk/vector/v.vol.rst/main.c
grass/trunk/vector/v.vol.rst/user1.c
grass/trunk/vector/v.vol.rst/user2.c
grass/trunk/vector/v.vol.rst/user3.c
grass/trunk/vector/v.vol.rst/vector.c
Log:
v.vol.rst: translate error/warning messages
All these messages need now to be translated separately (translator “hell” :):
- G_fatal_error(“Not enough memory for az”);
- G_fatal_error(_(“Not enough memory for az”));
adx = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!adx)
- G_fatal_error(“Not enough memory for adx”);
- G_fatal_error(_(“Not enough memory for adx”));
ady = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!ady)
- G_fatal_error(“Not enough memory for ady”);
- G_fatal_error(_(“Not enough memory for ady”));
adxx = (double *)G_malloc(sizeof(double) * (n_cols + 1));
if (!adxx)
[…]
A better way may be (needs to be properly declared, just as example)
G_fatal_error(_(“Not enough memory for %s”), mapname);
This reduces the work to one string and the rest comes in dynamically.
Furthermore it would be good to sync the messages to v.surf.rst to
make them as identical as possible.
Some best practice is described here:
https://trac.osgeo.org/grass/wiki/MessageStandardization
(which I now liked at
http://grasswiki.osgeo.org/wiki/GRASS_messages_translation)
Best
Markus
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
Remember, for developers there also is locale/README file containing
do's and dont's + how to handle messages with plural forms.
http://trac.osgeo.org/grass/browser/grass/trunk/locale/README
Also on both sides,
Maris.
2014-06-02 19:01 GMT+03:00 Huidae Cho <grass4u@gmail.com>:
Those links are good reads. Less hell for translators, and more typing for
developers. I'm on both sides.
On Mon, Jun 2, 2014 at 10:24 AM, Markus Neteler <neteler@osgeo.org> wrote:
Hi,
if I may make a suggestion on the message translation:
On Mon, Jun 2, 2014 at 4:14 PM, <svn_grass@osgeo.org> wrote:
> Author: hcho
> Date: 2014-06-02 07:14:16 -0700 (Mon, 02 Jun 2014)
> New Revision: 60669
>
> Modified:
> grass/trunk/vector/v.vol.rst/dataoct.c
> grass/trunk/vector/v.vol.rst/main.c
> grass/trunk/vector/v.vol.rst/user1.c
> grass/trunk/vector/v.vol.rst/user2.c
> grass/trunk/vector/v.vol.rst/user3.c
> grass/trunk/vector/v.vol.rst/vector.c
> Log:
> v.vol.rst: translate error/warning messages
All these messages need now to be translated separately (translator "hell"
:):
> - G_fatal_error("Not enough memory for az");
> + G_fatal_error(_("Not enough memory for az"));
> adx = (double *)G_malloc(sizeof(double) * (n_cols + 1));
> if (!adx)
> - G_fatal_error("Not enough memory for adx");
> + G_fatal_error(_("Not enough memory for adx"));
> ady = (double *)G_malloc(sizeof(double) * (n_cols + 1));
> if (!ady)
> - G_fatal_error("Not enough memory for ady");
> + G_fatal_error(_("Not enough memory for ady"));
> adxx = (double *)G_malloc(sizeof(double) * (n_cols + 1));
> if (!adxx)
[...]
A better way may be (needs to be properly declared, just as example)
G_fatal_error(_("Not enough memory for %s"), mapname);
This reduces the work to one string and the rest comes in dynamically.
Furthermore it would be good to sync the messages to v.surf.rst to
make them as identical as possible.
Some best practice is described here:
https://trac.osgeo.org/grass/wiki/MessageStandardization
(which I now liked at
http://grasswiki.osgeo.org/wiki/GRASS_messages_translation)
Best
Markus
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
Markus Neteler wrote:
if I may make a suggestion on the message translation:
On Mon, Jun 2, 2014 at 4:14 PM, <svn_grass@osgeo.org> wrote:
> Author: hcho
> Date: 2014-06-02 07:14:16 -0700 (Mon, 02 Jun 2014)
> New Revision: 60669
>
> Modified:
> grass/trunk/vector/v.vol.rst/dataoct.c
> grass/trunk/vector/v.vol.rst/main.c
> grass/trunk/vector/v.vol.rst/user1.c
> grass/trunk/vector/v.vol.rst/user2.c
> grass/trunk/vector/v.vol.rst/user3.c
> grass/trunk/vector/v.vol.rst/vector.c
> Log:
> v.vol.rst: translate error/warning messages
All these messages need now to be translated separately (translator "hell" :):
> - G_fatal_error("Not enough memory for az");
> + G_fatal_error(_("Not enough memory for az"));
> adx = (double *)G_malloc(sizeof(double) * (n_cols + 1));
> if (!adx)
> - G_fatal_error("Not enough memory for adx");
> + G_fatal_error(_("Not enough memory for adx"));
> ady = (double *)G_malloc(sizeof(double) * (n_cols + 1));
> if (!ady)
> - G_fatal_error("Not enough memory for ady");
> + G_fatal_error(_("Not enough memory for ady"));
> adxx = (double *)G_malloc(sizeof(double) * (n_cols + 1));
> if (!adxx)
[...]
Actually, there's no point in those messages even existing. G_malloc()
cannot return a null pointer, as it calls G_fatal_error() itself if
the underlying malloc() fails.
This has been the case since at least 4.2.1 (the oldest version I have
here).
Also: it should probably be using Rast_allocate_d_buf() (or
Rast_allocate_d_{input,output}_buf() if it's using a split window).
--
Glynn Clements <glynn@gclements.plus.com>