.net 什么是卫星组件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/365569/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is a satellite assembly?
提问by
What is a satellite assembly, and when should they be used?
什么是卫星组件,什么时候应该使用它们?
采纳答案by MOZILLA
A definition from MSDN says something like this: "A .NET Framework assembly containing resources specific to a given language. Using satellite assemblies, you can place the resources for different languages in different assemblies, and the correct assembly is loaded into memory only if the user elects to view the application in that language."
MSDN 的一个定义是这样说的:“一个 .NET Framework 程序集包含特定于给定语言的资源。使用附属程序集,您可以将不同语言的资源放在不同的程序集中,并且正确的程序集只有在用户选择以该语言查看应用程序。”
This means that you develop your application in a default language and add flexibility to react with change in the locale. Say, for example, you developed your application in an en-US locale. Now, your application has multilingual support. When you deploy your code in, say, India, you want to show labels, messages shown in the national language which is other than English.
这意味着您可以使用默认语言开发应用程序,并增加对区域设置变化做出反应的灵活性。例如,假设您在 en-US 语言环境中开发了应用程序。现在,您的应用程序具有多语言支持。例如,当您在印度部署代码时,您希望显示标签、以英语以外的国家语言显示的消息。
Satellite assemblies give this flexibility. You create any simple text file with translated strings, create resources, and put them into the bin\debug folder. That's it. The next time, your code will read the CurrentCulture property of the current thread and accordingly load the appropriate resource.
卫星组件提供了这种灵活性。您可以使用翻译后的字符串创建任何简单的文本文件,创建资源,并将它们放入 bin\debug 文件夹中。就是这样。下一次,您的代码将读取当前线程的 CurrentCulture 属性并相应地加载适当的资源。
回答by Jorge Garcia
A satellite assembly is a compiled library (DLL) that contains “localizable” resources specific to a given culture such as strings, bitmaps, etc.
You are likely to use satellite assemblies when creating a multilingual UI application. They are used to deploy applications in multiple cultures, with 1 satellite assembly per culture (default behavior)
附属程序集是一个编译库 (DLL),其中包含特定于给定文化的“可本地化”资源,例如字符串、位图等。
创建多语言 UI 应用程序时,您可能会使用附属程序集。它们用于在多种文化中部署应用程序,每个文化有 1 个卫星程序集(默认行为)
更多信息:http: //blogs.msdn.com/b/global_developer/archive/2011/07/22/introduction-to-satellite-assemblies.aspx

