Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a satellite assembly?

What is a satellite assembly, and how can we use it?

like image 962
Shantanu Gupta Avatar asked Dec 21 '09 18:12

Shantanu Gupta


People also ask

What is a Satellite Assembly in C++?

Background. A satellite assembly is a .NET Framework assembly containing resources specific to a given language. Using satellite assemblies, you can place resources for different languages in different assemblies, and the correct assembly is loaded into memory only if the user selects to view the application in that language.

What are the advantages of using satellite assemblies?

Because the satellite assemblies aren't part of the main assembly, you can easily update or replace resources that correspond to a specific culture without replacing the main assembly for the application. The resources of an application's default culture can also be stored in a satellite assembly.

How do I create a Satellite Assembly for an application?

Satellite assemblies can contain only resources; they can't contain any executable code. The following al.exe command creates a satellite assembly for the application Example from the German resources file strings.de.resources. al -target:lib -embed:strings.de.resources -culture:de -out:Example.resources.dll

What is a satellite assembly dll?

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.


2 Answers

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.

like image 68
Adam Robinson Avatar answered Oct 07 '22 00:10

Adam Robinson


Satellite assemblies are used for localizing your UI.

You can find out how to use them here.

like image 20
Oded Avatar answered Oct 07 '22 00:10

Oded