I assume that the langauge in question is one of the common ones, such as C, C ++, C #, Java, ... (You do not have a language with French keywords, I once met a fully Swedish version of Pascal, and I refused from this).
So you have two problems:
- Translation of identifiers into source code
- Comment translation
Since comments contain arbitrary text in natural language, you will need their arbitrary translation. I do not think you can find an automated tool for this.
Unlike others, I think that you have a good chance of translating identifiers and changing them massively.
SD creates the string source code "obfuscator" . These tools do not process the code as raw text, but process the source code in terms of the target language; they accurately distinguish identifiers from operators, numbers, comments, etc. In particular, they reliably work with the need only for identifiers.
One of the things these tools do is to replace one identifier name with another (usually a meaningless name) to make the code very hard to understand. Think abstractly about the identifier name map i → N. (They do other things, but that's not interesting here). Since you often want to re-obfuscate a file that has been changed, just like the original, these tools allow you to reuse the identifier card of the previous cycle, which is presented as a list of I → N pairs.
I think you can abuse it to do what you want.
Step 1: Run such an obfuscator on the source French code. This will create a text file containing all code identifiers, like a form map
I1 -> N1 I2 -> N2 ....
You don't care about Ns, just me.
Step 2: Manually translate each French I into the English name E, which you consider the best. (I have no specific suggestions on how to do this, some of the other answers have suggestions here). Some of them are likely to be library calls and therefore are already correct. You can modify the text obfuscation map file as follows:
I1 -> E1 I2 -> E2
Step 3: Run the obfuscation tool and make it use the modified obfuscation map. It can be said to do this.
Viola, all identifiers of your code will be changed as you specified.
[You can get re-formatting of the source text as a freebie. These tools can also format code well. Your name changes are likely to spoil the indentation / spacing in the source code, so this is a good bonus].