[GNC-dev] Translation

David Cousens davidcousens at bigpond.com
Tue Feb 19 23:38:26 EST 2019


The "%s" is usually a format specifier for a string in a print command. Most
computer languages allow substiutuion of the value of variables into string
of characters which is to be printed out.
The following command ina C program

 printf("The string is %s for my honey.\n", str);

would print

"The string is sugar for my honey"

followed by a new line if the value of the variable str in the program
was"sugar" .   The \n forces the output to go to a new line in this case.

You would need to translate the "The string is"  and "for my honey" parts
and leave the formatting symbols intact. Common format specifiers you might
come acroos could be "%s", "%d", "%c","%f", and you might also come across 
"\n", "\t" or "\r" for the newline, tab and carriage return function.  

You may also come across format specifiers like "%9.2f" which instructs the
print command to print a floating point number rounded to 2 decimal places
in a field 9 numbers wide, e.g. 123456.78 .

in short if come across format specifiers you should leave them in place and
just translate any bits of the stringeither side.

Hope this helps and doesn't confuse the issue further.

David Cousens

David Cousens
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-Dev-f1435356.html

More information about the gnucash-devel mailing list