使用“不同的语言”工作源代码

发布于 2024-08-14 03:45:28 字数 1431 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

天气好吗我好吗 2024-08-21 03:45:29

尝试按原样进行工作,而不翻译任何内容。如果不起作用,请开始按需翻译,仅翻译与您相关的部分。

一本字典已经可以让你走得很远了。您可以自行翻译代码元素。当然,不要再向拼图添加任何碎片。您添加的内容应该是英文的。

我还会通知客户,由于代码是根据非英语(甚至您不熟悉的语言)的常识和最佳实践编写的,因此将会出现交货延迟。归咎于小说的原作者。

Attempt to work on it as it is without translating anything. If it doesn't work, start translating it on-demand, only pieces that are relevant to you.

A dictionary can get you quite far already. You can translate code elements on your own. Naturally, don't add any more pieces to the puzzle. What you add should be in English.

I would also notify the customer that due to the code being written against common sense and best practices in non-English (and even unfamiliar to you language) there will be a delivery delay. Blame on the original creator of the novel.

人生百味 2024-08-21 03:45:29

除非这是 The Project From Hell,否则代码中的变量和方法应该远少于 15000 个。我的廉价建议是,您提取程序中找到的变量名称的交叉引用列表,雇用一个快速便宜的西班牙语电话来为您翻译这些名称,然后将翻译列表放在方便的地方,以便您和您的人使用。队友代码。

了解变量名的含义很方便,但这不是必需的。我花了 20 年的时间编写变量名中只有 4 个有效字符的程序。

Unless this is The Project From Hell, there should be far fewer than 15000 variables and methods in your code. My on-the-cheap suggestion would be for you to extract a cross-reference list of variable names as found in your program, hire a quick cheap Spanophone to translate those names for you, and then keep the translation list handy as you and your teammates code.

It's handy to have an idea of what is meant by a variable name, but it's not essential. I spent 20 years writing programs with only 4 significant characters in the variable name.

沧笙踏歌 2024-08-21 03:45:29

这是主观的,但我个人的观点是选项 B)雇用一位会说西班牙语的开发人员 - 主要是因为所有评论都可能是西班牙语,如果评论做得很好 - 它将包含不应被忽视的有价值的信息/ 丢失的。

翻译人员可能无法理解注释/代码中的术语,并且非程序员的翻译可能会很糟糕。

It's subjective, but my personal opinion is Option B) Hire a developer who can speak spanish - primarily because all the commenting will likely to be in spanish and if the commenting has been done well - it will have valuable information within that should not be ignored / lost.

A translator might not be able to understand the terms within the comments / code and a translation by a non programmer could go bad.

执手闯天涯 2024-08-21 03:45:29

最好的选择是与那些写了这该死的东西的人取得联系……如果可能的话。其次,懂西班牙语的开发人员。

Best option would be to get in touch with the guys who wrote the darn thing...if possible at all. Second best, a developer who knows Spanish.

澜川若宁 2024-08-21 03:45:29

首先翻译你的课程。然后您应该能够按实例的类型来跟踪实例。

Translate your classes first. Then you should be able to keep track of instances by their type.

简单爱 2024-08-21 03:45:29

抱歉,主要是问题......

客户会说西班牙语吗? 如果是这样,该软件应该由西班牙程序员编写。因为如果程序员了解客户,那么与客户沟通的成本就会少很多。

如果客户不是西班牙人,为什么还要使用西班牙程序员呢?

选择西班牙程序员是为了省钱吗?

如果是这样,该软件是否值得保留?

如果您看不懂西班牙语,您如何知道代码有多好?

Sorry mostly questions.....

Is the customer a Spanish speaker? If so the software should be written by a Spanish programmer. As the cost of communicating with the customer is a lot less if the programmer understands the customer.

If the customers is not Spanish, why was a Spanish programmer used at all?

Was the Spanish programmer chosen to save money?

If so, is the software worth keeping at all?

How can you tell how good the code is if you can’t read Spanish?

悲欢浪云 2024-08-21 03:45:29

我认为翻译应该按需进行,例如

  • 所有新代码都应该是“英语”。
  • 所有更改的方法都应该是“英文”
  • 新代码使用的所有类/方法都应该有英文名称和摘要注释。
  • 具有英文名称的类/方法的所有单元测试的名称和注释都应使用英文。
  • 当不清楚规范是什么时,应为任何类/方法编写缺失的单元测试。 (以便检查注释的英文翻译。)

我认为愿意的英语程序员将能够使用谷歌翻译来完成上述操作,但是与任何新的源代码库一样,该程序将不得不花费很长时间在使用每个类/方法之前真正了解它的作用。

懂得一些西班牙语的英语程序员能够更快地完成任务。但是,不要使用西班牙语程序员,因为您总是需要翻译员将其翻译成他们的母语。

I think the translation should be done as needed on demand, e.g

  • All new code should be in “English”.
  • All methods that are changed should be in “English”
  • All class/methods the new code uses should have English names and summary comments.
  • The names and comments on all unit tests for class/methods with English names should be in English
  • Missing unit tests should be written for any class/method when it is not clear what the spec is. (So as to check the translation of the comments into English.)

I think a willing English programmer will be able to use Google translate to do the above, however as with any new source code base, the programme will have to spend a long timer really understanding what each class/method does before using it.

An English programmer that knows some Spanish would be able to do it quicker. However don’t use a Spanish programmer, as you always want a translator translating into their native language.

哆兒滾 2024-08-21 03:45:29

第一步,当您继承遗留代码库时,无论它是否是您的母语,都是如此,即基于“已知良好”的输出设置回归测试,并开始编写更多测试,以适应您的更改。制作。

很可能,考虑到代码库的规模相对较小,您很快就会开始了解各种例程正在做什么,并且可能能够自己开始翻译工作,也许可以通过自动翻译进行补充。

这假设您了解问题领域,并且原始代码是专业编写的..尽管如果是的话,您已经进行了测试,不是吗?你没有提到是否是这样。

在没有回归测试的情况下在这里做任何事情都是鲁莽的。通过测试进行,您可能会发现整个任务相对容易管理,并且不需要认真的翻译工作。绝对尊重其他逐步完成此操作的建议。

First step, and this is true when you inherit a legacy code base whether it's in your native tongue or not, is to set up regression tests based on "known good" output, and begin writing more tests as you go, for the changes you make.

Quite possibly, given the relatively small size of the code base, you will fairly shortly start to understand what various routines are doing, and may be capable of beginning the translation effort yourself, maybe supplemented by automated translation.

This assumes you understand the problem domain, and that the original code was written professionally.. although if it were, you'd already have tests, wouldn't you? You don't mention whether that's the case.

Doing anything here without regression tests is foolhardy. Doing it with tests, you may find the whole task relatively manageable and don't need a serious translation effort. Definitely respect the other suggestions to do this incrementally too.

笑梦风尘 2024-08-21 03:45:29

我可以使用 反射方法等导出excel等。然后我可以将这个excel文件发送给西班牙语翻译。翻译后,我可以通过引用转换所有项目代码,这些代码是通过文本处理器应用程序翻译的 Excel 文件(查找/更改等)

I can get all of methods, fields, annotations and etc. with reflection methods and etc. to export excel or etc. Then I can send this excel file to spanish translator. After translated, i can convert all of project codes by reference which is translated excel file by text processor applications (find / change etc.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文