我什么时候应该使用“不变语言(不变国家)”?作为程序集的中性语言?

发布于 2024-11-16 14:47:28 字数 183 浏览 1 评论 0原文

目前我可以想到三种情况:

  • 不包含任何资源
  • 控制库的程序集,在其资源文件库中仅包含图像(即 ToolBoxBitmaps)
  • ,仅包含用于引发异常的文本(我们不希望用户无论如何,我们可以看到这些吗?;-) )

我对这些案例是否正确,还有其他我现在没有看到的吗?

At the moment I can think of three cases:

  • assemblies that don't contain any resources
  • control libraries that only contain images (ie. ToolBoxBitmaps) within their resource files
  • libraries that contain only text used for throwing exceptions (we don't want the user to see those anyway, do we? ;-) )

Am I right with these cases or not, and are there others I don't see right now?

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

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

发布评论

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

评论(1

红ご颜醉 2024-11-23 14:47:28

仅仅因为库仅包含非文本资源并不意味着它不需要本地化。图像可能也需要本地化,要么因为它们包含文本,要么因为它们受到文化偏见的显着影响(当然,据我所知,目前没有主要应用程序仅出于这个原因本地化图像)。还可能存在特定于语言/文化的声音文件。

此外,仅仅因为库中唯一的文本是异常文本并不意味着库不需要本地化。即使您可能不希望用户看到您的异常文本,您的开发人员仍然会看到它;并且并非所有开发人员都使用相同的语言。由于这个原因,BCL 中的所有异常文本都被本地化。

我真的不认为使用不变文化作为程序集的中性语言有任何优势。如果程序集中有资源,则应该对这些资源使用本机区域性。如果不这样做,也没关系,因此您不妨使用开发程序集(或最有可能使用)的本机文化,这样如果添加资源,则不必更改任何内容将来。

Just because the a library contains only non-text resources does not mean that it doesn't need to be localized. Images may need to be localized too, either because they contain text, or because they are significantly influenced by cultural biases (granted, I know of no major applications that currently localize images for only that reason). There may also be language/culture-specific sound files.

Also, just because the only text in the library is exception text also does not mean that the library does not need to be localized. Even though you may not want the user to ever see your exception text, your developers will still see it; and not all developers speak the same language. All exception text in the BCL is localized for this reason.

I don't really see any advantage to ever using the invariant culture as the neutral language for an assembly. If you have resources in the assembly, you should use the native culture for those resources. If you don't, it doesn't really matter, so you might as well use the native culture in which the assembly is developed (or most likely to be used), so you don't have to change anything if you add resources in the future.

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