[Scummvm-devel] [SPAM] Re: Improving translation support in ScummVM

Max Horn max at quendi.de
Fri Jun 25 09:36:06 CEST 2010


Regarding format strings, two remarks:

1) gettext has some support for (re)ordering format arguments in localized text, by specifying an "order" value in the format specifiers. I added a remark about that that to our Wiki some time ago, BTW. However, this will probably not help us directly, unless we implement our own custom vsnprintf with support for that and then use that consistently on all ports... Still, this might show a possible approach.

2) We could alleviate some of the issues with format strings by using a special macro for these, which does nothing:
 #define _f(x) x
which can still be used to scan for text that may be translated. But then, we do the actual lookup for the translated text inside debug/warning/error. *if* we decide we want to translate those.

BTW, that reminds me, we may want to deprecate any use of (f)printf in our code and introduce our own replacement for that (which on desktop ports could just be #defined to call printf). The idea is that this would make it easier for ports to handle such output (which is on the console, yet not just pure debug output) specially. E.g. a game console ports might wish to show such message during startup time. 


Bye,
Max





More information about the Scummvm-devel mailing list