为什么 Satellite Assembly 不在 Winform 应用程序中使用

发布于 2024-12-22 19:38:31 字数 96 浏览 1 评论 0原文

我有一个 winform 应用程序,它使用自己的本地化机制。它不使用卫星程序集,我不知道为什么。 Satellite 程序集不适合 winforms 应用程序本地化有什么原因吗?

I've got a winform application which uses it's own mechanism for localization. It doesn't use Satellite assemblies and I am not sure why. Are there any reasons that Satellite assemblies not suitable for winforms application localization?

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

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

发布评论

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

评论(3

心奴独伤 2024-12-29 19:38:31

在大多数情况下,通过卫星组件进行本地化是最好的选择。这是标准做法,应该遵循,除非您有充分的理由不这样做。

创建自己的解决方案的充分理由:

  • 您的用户界面是动态的,即文本经常变化很大(即取决于客户)。在这种情况下,将可翻译的资源和相应的翻译保留在数据库中是有意义的。
  • 与您合作的翻译人员对 XML 和技术翻译一无所知,因此让他们翻译 resx 文件太危险了。在这种情况下,您可能想要实现自己的解决方案,即在类似配置的文件中进行翻译。
  • 您是老板,您比主题专家更了解 i18n,并且您将纠正 Microsoft 工程师的这种蹩脚的实现。当然不是你,而是原始开发人员 - 通常是一些自负的人或患有非发明综合症的人可能会认为提供“更好”的解决方案是一个好主意

对于应用程序使用非标准方法的真正原因,你可能需要询问原始开发人员(或其他可能知道答案的人)。根据我的经验,这可能是上面列出的原因之一,通常是第三个。

In most cases Localization via Satellite Assemblies is the best possible option. This is a standard practice and it should be followed unless you have good reasons not to.

The good reasons for creating your own solution:

  • Your User Interface is dynamic that is texts often change quite a lot (i.e. depending on the customer). In such case it makes sense to keep translatable resources and corresponding translations in the database
  • The translators you are cooperating with do not know the first thing about XML and technical translations, therefore having them translating resx files is too dangerous. In such case you might want to implement your own solution, i.e. having translations in config-like files
  • You are the boss, you know i18n better than subject matter experts and you are going to correct this lame implementation of Microsoft engineers. Not you of course but original developer - usually somebody with huge ego or somebody suffering from Not Invented Here syndrome might think it is a good idea to come with "better" solution

For the real reason why the application uses non-standard approach, you probably need to ask the original developer (or somebody else who might know the answer). From my experience it would be one of the reasons listed above, quite often the third one.

诗化ㄋ丶相逢 2024-12-29 19:38:31

我做了以下步骤。

  1. 创建窗口窗体应用程序
  2. 添加文件夹资源
  3. 添加新Resource1.resx
    添加一项
  4. 复制 Resource1.resx 并粘贴为 Resource1.da-DK.resx
  5. 现在构建 .. 如果您查看 Debug 文件夹,它包含目录“da-DK”,它是“da-DK”资源的卫星程序集。

这种方式我在很多应用中都使用过。

您还可以在特定文化中运行应用程序。

I did following steps.

  1. Create Window Form Application
  2. Add Folder Resource
  3. Add New Resource1.resx
    Add One Item
  4. Copy Resource1.resx and Paste as Resource1.da-DK.resx
  5. Now build .. if you look at Debug folder it contain directory "da-DK" that is satelite assembly of resource for "da-DK".

This way i used in many application.

Also you have run application in specific culture.

如日中天 2024-12-29 19:38:31

使用卫星资源组件是开发全球可用的应用程序的常见方法。要了解有关本地化的更多信息,请参阅本地化应用程序< /a> 在 MSDN 中。

检查有关此内容的 DevExpress 文档,以及使用 Satellite Assembly 对各种 Windows 应用程序进行本地化

您是否在文档中检查过这些内容:
本地化 DevExpress .NET Windows 窗体控件
本地化 Windows 窗体
提高本地化表单的性能

有一本书名为.NET 国际化:开发人员指南在此上下文中构建全局 Windows 和 Web 应用程序..

Using Satellite Resource Assemblies is a common approach for developing world-ready applications. To learn more about localization, refer to Localizing Applications in MSDN.

check DevExpress documentation about this and various windows applications are localized using Satellite Assembly

Have you checked these on documentation:
Localizing DevExpress .NET Windows Forms Controls
Localizing Windows Forms
Improving Performance of Localized Forms

There is a book named .NET Internationalization: The Developer's Guide to Building Global Windows and Web Applications in this context..

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