GiD - The personal pre and post processor

Strings with variable parameters

If there are variables to substitute in the string, you must write %s, %i, %f in the position of the string, integer or real, and move the variable as an extra parameter.
The _ procedure performs a "format" to compose the final string.
For example:

set a "User $username running $nproc threads"


It must be rewritten as:

set a [_ "User %s running %i threads" $username $nproc]


Warning: If the source string and its translation have different %format codes, the program using this translation may crash uncontrollably at runtime.

To avoid these situations, there is a special menu:
Messages -> Check for errors
To look for inconsistencies (of format) in translated sentences.

For example, it is an error to translate the phrase "Copied %d files" in Spanish to "Copiados %f ficheros", because %d expects an integer parameter while %f expects a real number.


COPYRIGHT © 2022 · GID · CIMNE