翻译源代码中的注释和区域名称
有谁知道批处理程序或 VS 2010 插件/脚本可以让我将注释和区域名称从中文翻译成英文?
我发现的唯一一个要么处理所有字符串,要么一次只处理一个字符串。
我有两个大型 C# 项目正在尝试通读。
谢谢。
Does anyone know of a batch processor or a VS 2010 plugin/script that would let me translate comments and region names from Chinese into English?
The only ones I've found either process all strings or only one string at a time.
I have two large C# projects that I am trying to read through.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 PrepTags 准备要翻译的文件。它将允许您根据正则表达式选择要翻译的文本。
www.preptags.com
您可以免费逐个文件工作,或使用专业版( €39)
就您而言,准备起来非常简单。您只需将所有内容标记为受保护,然后取消对评论和评论内容的保护。地区名称。
披露:我开发 PrepTags。
Use PrepTags to prepare your file for translation. It will allow you to select the text to be translated based on regex.
www.preptags.com
You can work file by file for free, or process the files as batch using the pro version (€39)
In your case, it's pretty simple to prepare. You just mark everything as protected, then unprotect the content of the comments & region names.
Disclosure: I develop PrepTags.
如前所述,您可以使用 Google Translate API 或 Bing Translator API。您可以使用 System.CodeDom 检测文件中的注释和区域。
As was noted, you can use Google Translate API or alternatively Bing Translator API. You can detect comments and regions in your files using System.CodeDom.
我不太确定是否可以。您可以做的帮助将是以下内容:
1)确保两个C#项目都有属性> Build> XML文档文件复选框选中。
2.1)编写一个在生成的XML文件中读取的应用程序。
2.2)解析文件,每个值都会呼叫Google翻译以获取翻译值。
2.3)将翻译值放在另一个具有与构建项目相同的XML文件中。
这不能解决您转化区域名称的愿望,而是一个开始。至少在使用两个项目时,您将有智能。
对于一个小型开源项目来说,这实际上是一个好主意。我可能决定捡起它。如果我这样做,我会告诉你。
I'm not too sure if this is possible. What you can do to help would be the following:
1) Make sure that both C# projects have the Properties > Build > Xml document file check box checked.
2.1) Write an application that reads in the generated xml file.
2.2) Parse the file, and for each value make a call to Google Translate to get the translated value.
2.3) Place the translated value within another xml file that has the same structure as the one created from building the project.
This wouldn't solve the your desire to translate the region names, but its a start. At least you would have intelligence when using the two projects.
This is actually a good idea for a small open source project. I may decide to pick it up. If I do, I'll let you know.