If Google translate translates is good enough, here is a method that will work for C ++ comments ( // ...
), rude but effective:
Isolate the comments: sed -e 's|.*//|//|' -e '/\/\//!s|.*||' sourcefile > comments Remove the comments from the source: sed 's|//.*||' sourcefile > barecode Use Google translate on comments. paste -d '\0' barecode comments > sourcefile
source share