有没有工具可以只翻译代码中的注释
Is there any tool which can translate only comments in the code
我有一些c ++源文件,其中包含意大利语的注释,是否有任何工具可以将注释仅翻译成英语。我尝试过谷歌翻译,它会翻译整个文件,并且//也会被翻译。因此,从谷歌的翻译结果粘贴不会给出有效的 c++ 源文件。
有什么想法吗?
谢谢。
如果谷歌翻译翻译得足够好,这里有一种方法可以适用于C++评论(// ...
),粗糙但有效:
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 ' ' barecode comments > sourcefile
相关文章:
- 注释一行使代码工作,而没有它,代码不起作用
- Visual Studio Community 代码分析的质量与 SAL 注释
- C++,在多行代码段中注释
- C(嵌入式):注释 FreeRTOS 的 RootTask 时代码大小不会缩小
- 如何确保 C/C++ 代码中不会缺少 doxygen 风格的文档注释?
- 删除被注释掉的代码,而不是实际的赞美
- 为什么我的程序在删除以下代码中的注释后会出现运行时错误?
- 每当我运行注释代码时,程序就会崩溃
- 大括号的作用域是否用于注释目的,从而降低C++代码的速度
- 区分注释代码与有效注释
- C++ 中代码的注释块
- 为什么添加内联程序集注释会导致 GCC 生成的代码发生如此根本的变化?
- 我怎样才能让 Emacs 用我的代码缩进我的 // 注释
- 在C++代码中使用C风格的注释是不是一种糟糕的做法
- 为什么当注释"cout"时此代码不起作用?
- 注释C/C 代码
- 在代码注释中接受字符串结果
- Visual Studio 2010在没有错误的情况下,错误地在代码/注释下面加上红色错误线
- 灯光引擎:代码注释约定
- 很好的代码注释技巧