Thursday, October 26, 2006

What are Satellite Assemblies in .NET ?

Satellite assemblies are assembly files (.dll) that contain localized resources for an application. Each satellite assembly file contains the resources for one culture. An application can have many satellite assemblies, depending on how many cultures the application supports.

Web application projects use satellite assemblies to store the translated strings, graphics, and other culture-dependent aspects of an application’s user interface. To create the assemblies themselves, you use the Resource Manager. At run time, the Web application loads the translated strings into the Web form based on the current thread’s CurrentUICulture property

Enabling HTML Elements for Resources
Resources from satellite assemblies are loaded into Web form elements on the server side. Therefore, you need to make sure that all the elements on your Web form have id and runat attributes that make them available from server-side code. By default, ASP.NET server controls have these elements; however, HMTL elements do not.


Use the Request object’s UserLanguages array to detect the user’s culture.

Set the culture and uiCulture attributes of the globalization element in Web.config to create culture-specific Web applications.

The .NET Framework identifies cultures using the language and region codes listed in the “CultureInfo Class” online Help topic.

Set the culture used by the application for formatting dates, currencies, numbers, and determining sort order using the Thread class’s CurrentCulture property.

Use the Thread class’s CurrentUICulture to determine which satellite assembly is used to load localized resources.

Add id and runat attributes to HTML elements to be able to display localized strings from resource files in those elements at run time.

Elements within a resource file are case sensitive and must be uniquely named within the scope of the application, so use a naming convention such as webform.id.

When creating Web forms that use non-ASCII characters, save the file using the UTF-8 character encoding with a signature. Including the signature allows ASP.NET to automatically detect the file’s encoding.

1 comment:

Arumugam said...

this is useful and easy to understand. Always we look for juice rather than fruit.. is nort it :)

Digg it !