I have written a Perl script to run an automatic translation of the C/C++ source code identifiers, using a simple list file for old->new identifiers. This works quite well for the actual source, checking for any conflicts beforehand, which is possible because the whole relevant code is accessible. With some changes to the translation table, it would be usable by the forked projects, too. I have not looked at Hajo's translations, but they could be integrated as well.
The problem is not so much with the code, but with the comments:
They are not treated specially yet, but I intend to change this. The current state leads to the ugly effect that single words in German comments are translated (rather than feeding whole paragraphs to some Babelfish successor
). However, I cannot simply omit stuff in comments, because they often refer to identifiers, some even contain commented-out code lines, and they are used by diff
. This will not be solvable in an optimal way. (If there are nested /**/ comments, they make handling even more difficult - I would rather remove nesting by separate patches.)
I already try to support .diff files, but their context part does not tell reliably what line is a comment, so they depend on translated comments, thus the easiest way would be to translate comments in all cases, but disregard them for conflict checks. Otherwise, I would have to emulate patch
as well and compare to the original file, which I probably will not try at all.
Of course, my translation list is far from complete. Currently, 31,571 string replacements will be suggested (including comments). The current impediment is the set of false identifier conflicts caused by comments and, to a smaller extent, code already using English identifiers that are the same as natural translations of the German ones.
Not to forget: I have not seen a missing text translation (caused by my changes) in the game yet, but if that became a problem, separate handling of strings would be mandated.
(edited to improve transfer of information to the reader)