RSS

Satellite Assemblies

15 Mar

What Is a Satellite Assembly? 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.”

Creating a Satellite Assembly

  1. Create a folder with a specific culture name (for example, en-IN) in the application’s bin\debug folder.
  2. Create a .resx file in that folder. Place all translated strings into it.
  3. Create a .resources file by using the following command from the .NET command prompt. (localizationsample is the name of the application namespace. If your application uses a nested namespace structure like App.MyApp.Name.MyName as the type of namespace, just use the uppermost namespace for creating resources files—MyApp.)
    resgen Strings.en-IN.resx LocalizationSample.
       Strings.en-IN.resources
    al /embed:LocalizationSample.Strings.en-IN.resources
       /out:LocalizationSample.resources.dll /c:en-IN

    The above step will create two files, LocalizationSample.Strings.en-US.resources and LocalizationSample.resources.dll. Here, LocalizationSample is the name space of the application.

  4. In the code, find the user’s language; for example, en-IN. This is culture specific.
  5. Give the assembly name as the name of [test].resx file.

How to use Satelite assembly ??

Thread.CurrentThread.CurrentCulture =   CultureInfo.CreateSpecificCulture(MyCult);
Thread.CurrentThread.CurrentUICulture =   new CultureInfo(MyCult);
ResourceManager resMgr =   new ResourceManager(typeof(Form1).Namespace + “.” +
assemblyName, this.GetType().Assembly);

For more please visit http://www.codeguru.com/csharp/.net/net_general/tipstricks/article.php/c11367

btnSubmit.Text = resMgr.GetString(“Click”);

 

Thanks & Regards

Azhar Saiyed

pirimamshahbawa.org/

 

Advertisements
 
Leave a comment

Posted by on March 15, 2011 in Uncategorized

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: