GiD - The personal pre and post processor

Marking C/C++ code

In this case instead of [_ ] you have to use the macro _() to enclose the string to translate,
For example:

printf ("hello world");

You must write

printf (_ ("hello world"));

In C/C ++ there is no the Tcl casuistry due to substitution, and the parameters are written as desired after the format string:
For example:

printf("User %s running %i threads",username,nproc);

Must be written

printf(_("User %s running %i threads"),username,nproc);


As in Tcl, care must be taken not to try to translate keywords, program "includes", and so on.

To include the macro _() in any project, without dragging other declarations of unwanted functions, it has been isolated from the "Main.h" file to a new header file, called "Trad.h"

As an alternative to Msgcat, the option of using gettext was considered, but it was discarded due to several inconveniences:
It is originally from UNIX platforms, you have to tweak it for Windows.
It only works for C/C ++ files, but not for Tcl files.
It has a string extraction program but only for C/C ++, not for Tcl.
Msgcat is suitable for Tcl and C/C ++, and comes standard with Tcl (thus ensuring maintenance)

COPYRIGHT © 2022 · GID · CIMNE