Translating comments and region names in source code

前端 未结 3 1986
名媛妹妹
名媛妹妹 2021-01-18 06:10

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

相关标签:
3条回答
  • 2021-01-18 06:52

    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.

    0 讨论(0)
  • 2021-01-18 07:07

    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.

    0 讨论(0)
  • 2021-01-18 07:08

    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.

    0 讨论(0)
提交回复
热议问题