[GRASS translations] gettext macro update
Markus Neteler
neteler at itc.it
Wed Nov 17 03:53:30 EST 2004
Dear translators,
the procedure to add further gettext macros (the indication
for messages to get extracted for translation) has changed:
A further change is necessary which now gives advantage to
allow other external software (QGIS, whatever) to make use of
GRASS messages.
In details (revised procedure):
Generally, to support i18N multiple languages, message strings
in GRASS must be modified from
fprintf ( ..., "...\n", ...);
to
G_message ( _("..."), ...);
4 Steps:
a) to replace:
- fprintf (stdout, with G_message (
- fprintf (stderr, with G_message (
b) to add:
- the macro _( )
c) to remove:
- \n at the end of single message strings
d) Also needed to be added:
#include "glocale.h"
This line has to be added to each C file which contains
user messages, preferably as last #include statement.
Such strings will be then extracted automatically into
the POT file(s).
See for example ./vector/v.what.rast/main.c
Enjoy the search-replace function of your preferred
editor to do these changes. Please check carefully
the changes then.
Finally, to submit, just create a CVS snapshot:
cvs diff -u file > file.diff
Then submit the diff file(s) to either me or another
developer.
Thanks!
Markus
More information about the grass-translations
mailing list