Which is the best way to go forward while building a localized aspx web application, .resx files of satellite assemblies? Is there any performance comparisons available any where on web?
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.
Create a folder in whatever project you want to store the resx files in - default, call it "Resources". Create a new resx file with the specific culture and the file name you'll look up later: If you had a shared one, you could do: SharedResource. en-US. resx.
resx resource file format consists of XML entries that specify objects and strings inside XML tags. One advantage of a . resx file is that when opened with a text editor (such as Notepad) it can be written to, parsed, and manipulated.
Well I don't know if the comparison is valid..
ResX is a storage format for storing resources in XML. It gets compiled to a binary form (.resources) with the resgen tool before it gets embedded (if so specified) into the assembly.
Satellite assembly is a diff/delta of your main assembly resources and your localized resources. So if you have a Strings.resx with 100 strings in MainAssembly.dll of which 10 change in French Canadian Culture, you should have a MainAssembly.resources.dll (satellite assembly) containing just those 10 strings in the fr-CA subdirectory of the DLL folder. When you query for a string resource using a ResourceManager, it takes into account current culture. If fr-CA, it will first look for the string in the satellite assembly in the fr-CA folder, if not found it will fall back to the resources in the DLL itself and return that. The mechanism is to search for it in the following order always.
- [fr-CA subfolder]\MyAssembly.resources.dll
- [fr subfolder]\MyAssembly.resources.dll
- DLL itself
For more details, check out http://www.dotneti18n.com/ or the Resources chapter of 'Programming WPF'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With