如果这是针对开发者的异常信息进行本地化? [英] Should exception messages that are targeted to the developer be localized?

查看:188
本文介绍了如果这是针对开发者的异常信息进行本地化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我指的是,展示了开发者使用API​​错误的异常信息。例如错误地传递一个空到方法。除了这样的类型,开发人员将在第一时间拿到他们所运行的不正确code。要显示给一个系统的用户异常的消息,应该永远得不到的类型。

I am referring to exception messages that show the developer is incorrectly using an API. For example incorrectly passing a null to method. So the type of exception that the developer will get the first time they have run their incorrect code. The type of exception message that should never get to be displayed to the user of a system.

这是一种涉及到,由于编程语言是英语那么程序员已经有英语的理解理论。或者至少足以破译的异常信息。

This is kind of related to the theory that since the programming language is in English then the programmer already has an understanding of English. Or at least enough to decipher an exception message.

http://www.codinghorror.com/blog/archives/001248.html (请这个理论在这里不讨论)

http://www.codinghorror.com/blog/archives/001248.html (please no discussion of this theory here)

是的,我知道,.NET框架遵循本地化一切的做法。

And yes I know that the .net framework follows the "localize everything" approach.

推荐答案

您的问题可以被改述为应该都是开发商拿同样的错误信息,使他们可以Google一下? ;)

Your question can be rephrased as "should all developers get the same error message so that they can Google it?" ;)

和这个问题的答案是肯定的。

And the answer to that is yes.

翻译表示

  • 的消息不再相同,谁写的API预期。它可能具有同样的含义,也可能失去了一些东西在翻译中。它可能被严重翻译,并且在某些情况下,可能透顶不可读。
  • 谁读它不能简单地键入错误到谷歌,看看有什么其他人谁得到这个错误一样。因为其他人都在不同的语言得到了同样的错误。

关于.NET的本土化一切的做法,这是可怕的。我已经绊倒了由这无数次,特别是因为如果它无法找到本地化的资源,它的不可以给你简单的英语版本。它给你一个无法找到资源错误,而不是,有效地扔掉实际的错误信息。

About .NET's "localize everything" approach, it is horrible. I've been tripped up by it countless times, especially because if it is unable to find the localized resource, it does not give you the plain English version. It gives you a "Could not locate resource" error instead, effectively throwing away the actual error information.

这篇关于如果这是针对开发者的异常信息进行本地化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆