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
- Create a folder with a specific culture name (for example, en-IN) in the application’s bin\debug folder.
- Create a .resx file in that folder. Place all translated strings into it.
- 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.
- In the code, find the user’s language; for example, en-IN. This is culture specific.
- 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/