what is the best way to get this long r.mapcalc/main.c message into the
.po files?
static const char help_text =
"r.mapcalc - Raster map layer data calculator\n"
"\n"
"usage: r.mapcalc '<map>=<expression>'\n"
"\n"
"r.mapcalc performs arithmetic on raster map layers.\n"
"\n"
"New raster map layers can be created which are arithmetic expressions\n"
"involving existing raster map layers, integer or floating point
constants,\n"
"and functions.\n" "\n" "For more information use 'g.manual r.mapcalc'\n";
what is the best way to get this long r.mapcalc/main.c message into the
.po files?
static const char help_text =
"r.mapcalc - Raster map layer data calculator\n"
"\n"
"usage: r.mapcalc '<map>=<expression>'\n"
"\n"
"r.mapcalc performs arithmetic on raster map layers.\n"
"\n"
"New raster map layers can be created which are arithmetic expressions\n"
"involving existing raster map layers, integer or floating point constants,\n"
"and functions.\n" "\n" "For more information use 'g.manual r.mapcalc'\n";
On Wed, Jul 18, 2012 at 8:15 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:
Markus Neteler wrote:
what is the best way to get this long r.mapcalc/main.c message into the
.po files?
static const char help_text =
"r.mapcalc - Raster map layer data calculator\n"
"\n"
"usage: r.mapcalc '<map>=<expression>'\n"
"\n"
"r.mapcalc performs arithmetic on raster map layers.\n"
"\n"
"New raster map layers can be created which are arithmetic expressions\n"
"involving existing raster map layers, integer or floating point constants,\n"
"and functions.\n" "\n" "For more information use 'g.manual r.mapcalc'\n";
Does enclosing the string in _(...) not work?
For me no, I get in the last row:
error: invalid initializer
Hello Markus,
You can't use function to initialize a array (string) in C (Glynn can
correct me, if I'm wrong).
I just moved help text to main to be able to extract that string in
r52421 for 6.4.
Cheers,
Maris.
2012/7/19 Markus Neteler <neteler@osgeo.org>:
On Wed, Jul 18, 2012 at 8:15 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:
Markus Neteler wrote:
what is the best way to get this long r.mapcalc/main.c message into the
.po files?
static const char help_text =
"r.mapcalc - Raster map layer data calculator\n"
"\n"
"usage: r.mapcalc '<map>=<expression>'\n"
"\n"
"r.mapcalc performs arithmetic on raster map layers.\n"
"\n"
"New raster map layers can be created which are arithmetic expressions\n"
"involving existing raster map layers, integer or floating point constants,\n"
"and functions.\n" "\n" "For more information use 'g.manual r.mapcalc'\n";
Does enclosing the string in _(...) not work?
For me no, I get in the last row:
error: invalid initializer
You can't use function to initialize a array (string) in C (Glynn can
correct me, if I'm wrong).
Correct.
You can't use a function call to initialize static variables (i.e.
global variables or "static" local variables) or any array (whether
static or automatic).
I was thinking about it from the xgettext side (i.e. whether xgettext
recognises concatenated string literals split over multiple lines)
rather than from the C side, so I completely overlooked that issue.
From the C side, using:
const char *help_text = _("...");
inside main() would work. That may be preferable to putting a large
string literal inside the fputs() call.
You can't use function to initialize a array (string) in C (Glynn can
correct me, if I'm wrong).
Correct.
You can't use a function call to initialize static variables (i.e.
global variables or "static" local variables) or any array (whether
static or automatic).
I was thinking about it from the xgettext side (i.e. whether xgettext
recognises concatenated string literals split over multiple lines)
rather than from the C side, so I completely overlooked that issue.
From the C side, using:
const char *help_text = _("...");
inside main() would work. That may be preferable to putting a large
string literal inside the fputs() call.
> From the C side, using:
>
> const char *help_text = _("...");
>
> inside main() would work. That may be preferable to putting a large
> string literal inside the fputs() call.
Just my curiosity as I'm not a good programmer (more coder than
programmer) - why using large string literal in fputs is so bad idea?
On Sat, Jul 21, 2012 at 6:13 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:
Maris Nartiss wrote:
> From the C side, using:
>
> const char *help_text = _("...");
>
> inside main() would work. That may be preferable to putting a large
> string literal inside the fputs() call.
Just my curiosity as I'm not a good programmer (more coder than
programmer) - why using large string literal in fputs is so bad idea?
Legibility.
Could anyone please forward-port r52421 to GRASS 7 in the
desired better way? (I have done it in r52991 for G6.5 the "old" way).