Last post Aug 10, 2007 11:28 AM by aweil
Aug 09, 2007 11:33 AM|CathyA|LINK
I have to make my webapp multilingual in .NET 2. There's a nice way to do this with global and local resource files. But I also found articles about sattelite assemblies which should wrap all my resource files in a single xxx.resource.dll for each language.
(I didn't get it working though)
Which aproach should I use, and why? Is there a difference in performance?
Visual Studio 2005
Aug 10, 2007 08:48 AM|aweil|LINK
The truth is, when you use the global and local resource files, ASP.NET 2.0 automatically compiles them into satellite assemblies (xxx.resource.dll as you wrote).
So it's just the same, with exact same performance. This means you can go the easiest way, that is, using resource files.
As you're working with localization, you may want to have a look at my following tutorials:
Hope this helps,
Aug 10, 2007 09:29 AM|CathyA|LINK
Thank you, I'll read your tuturials (like the idea of automated translation very much!)
Thought that you could compile the .resx into a dll (located in bin\En of bin\Fr dir) so that you didn't have to deploy al the resx files. I managed to create that dll's (when I choose 'embedded resource' as build action for the resx files, but I still
needed the resx files to run the webapp.
Do you know if there's a difference in performance by using global or local resource files? I don't like all those small local files for translation by third party.
Visual Studio 2005
Aug 10, 2007 09:57 AM|aweil|LINK
In general, there are two ways to work with ASP.NET 2.0.
Dynamic compilation: you upload xxx.aspx.cs (CodeBehind), xxx.cs (code) and xxx.resx to the server, which will compile them into a xxx.dll plus bib/en/xxx.dll (and so on) the first time a page is requested.
Static compilation: you compile the project on your machine, and upload only the xxx.dll, bib/en/xxx.dll plus any content file (xxx.aspx, for instance).
Is this clear enough?
Both give you the same amount of performance, except for the very first page's response time after you upload your files.
The real difference comes from the fact that you may not want the web site to have your code as plain C# files.
As far as your second question is concerned, I'm not aware of any performance difference between global and local resources. I like local resources because they make it easier to relate the information to a page. Normally, a translator best performs when
(s)he knows the context where the words are used...
Aug 10, 2007 10:52 AM|CathyA|LINK
Thanx for you time, I almost get it :)
I don't want my code files published, so I always compile on my machine. But I don't get bin/en/xxxx.dll when I use resource files and I still need to deploy the .resx files.
How can I static compile the .resx files into a single dll per language and leave the resx files from the production env.?
Aug 10, 2007 11:28 AM|aweil|LINK
In Visual Studio 2005, when you "Build" you only half-build (I know, it sounds strange, it was much more straightforward in VS2003), so the resources don't get generated.
If you want to deploy just the satellite assemblies instead of the resource files, go in the "Build" menu; there's a "Publish Web Site" option. It opens a dialog box, where you should uncheck the "Allow this precompiled site to be updatable", and that's
Know what? It'd would be kind of you to mark my posts as "Answers" if they helped you...