Web based commerce is increasing exponentially and the companies, retailers, banks etc are responding to the diverse nature of its world wide clientele. In the US the main concerns are for english (en) and Spanish (es) speaking counterparts.
I have been doing a lot of work recently with Satellite assemblies. By definition, satellite assemblies only contain resource files (.resx). They do not contain any application code. These assemblies are generally reserved for strings that can be used to support a particular culture or language. In the satellite assembly deployment model, you create an application with one default assembly (which is the main assembly) and several satellite assemblies (en, es, etc).
Visual Studio (VS) has an implied strategy for creating satellite assemblies it looks for a specific naming scheme for .resx files.
Strings.en.resx - Implies the need for a satellite assembly named strings.en.dll
Strings.es.resx - Implies the need for a satellite assembly named strings.es.dll
Strings.resx - Will not create a satellite assembly, this will be embedded in the default assembly based on the build action.
Now in order for the default assembly to have knowledge of an associated satellite assembly there also needs to be an explicit reference applied during compilation as follows (VS does this for us).
csc.exe /debug+ /reference:..\Bin\en\strings.en.dll;..\Bin\es\strings.es.dll/out:..\Bin\MyApp.exe 'syntax maybe a little off
Updating information in a satellite assemblies is really a trivial task, and is certainly the way to go if you are in a hurry and need to avoid a full rebuild. So taking the case where you have existing a MainApp.exe and a Strings.en.dll associated with the main app. To update the Satellite assembly do the following:
- Update the resx file as required (Please note you cannot add information here without recompiling the default assembly).
- run the following command (VS.NET cmd): resgen MyWeb/Resources/Strings.en.resx Strings.en.resources
- run the following command (VS.NET cmd): al /out:Strings.en.dll /c:en /embed:Strings.en.resources
"I have learned that success is to be measured not so much by the position that one has reached in life as by the obstacles which he has had to overcome while trying to succeed." - Booker T. Washington
Comments are closed.