开发者

What is a satellite assembly?

开发者 https://www.devze.com 2022-12-14 18:06 出处:网络
What is a satellite assembly, a开发者_如何学JAVAnd how can we use it?Satellite assemblies are small assemblies that contain only resources and are specific to a particular language (or, more accuratel

What is a satellite assembly, a开发者_如何学JAVAnd how can we use it?


Satellite assemblies are small assemblies that contain only resources and are specific to a particular language (or, more accurately, culture). For instance, say I have an assembly called "MyAssembly.dll". If I had translations for US English and Chinese (PRC), the file structure would look like this:

MyAssembly.dll
en-US/
    MyAssembly.resources.dll
zh-CN/
    MyAssembly.resources.dll

Each of the .resources.dll files would contain the data from any culture-specific resource files that would be in the project (they would take the form of FileName.culture.resx, so if we're talking about the US English translation of Form1's resources, it would be Form1.us-EN.resx).

As for using these files, this is done automatically by the resource manager. In the generated code for a resources file (that gives you the property-based syntax for reading a resource's value) it uses the current UI culture, but you can override this by calling the ResourceManager.GetString(string name, CultureInfo culture) overload.


Satellite assemblies are used for localizing your UI.

You can find out how to use them here.


  1. A satellite assembly is a compiled library (DLL) that contains “localizable” resources specific to a given culture such as strings, bitmaps, etc.

  2. 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)

More here: http://blogs.msdn.com/b/global_developer/archive/2011/07/22/introduction-to-satellite-assemblies.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号