locked
What kind of localization should I use RRS feed

  • Question

  • User-1217001449 posted

    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?

    Thursday, August 9, 2007 11:33 AM

Answers

  • User764555827 posted

    Hi Cathy,

    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:

    Tutorial: Translating an ASP.net Web application

    Trick: Automated translation of a resx file

    Tutorial: Localize a Web.sitemap file

    Using a resource in an ASP.NET Theme (Tutorial)

    Hope this helps,

    Arnaud

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 10, 2007 8:48 AM
  • User764555827 posted

    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...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 10, 2007 9:57 AM
  • User764555827 posted

    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 it.

    Know what? It'd would be kind of you to mark my posts as "Answers" if they helped you... 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 10, 2007 11:28 AM

All replies

  • User764555827 posted

    Hi Cathy,

    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:

    Tutorial: Translating an ASP.net Web application

    Trick: Automated translation of a resx file

    Tutorial: Localize a Web.sitemap file

    Using a resource in an ASP.NET Theme (Tutorial)

    Hope this helps,

    Arnaud

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 10, 2007 8:48 AM
  • User-1217001449 posted

    Hi Arnaud,

    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.

    Friday, August 10, 2007 9:29 AM
  • User764555827 posted

    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...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 10, 2007 9:57 AM
  • User-1217001449 posted

    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.?

     

    Friday, August 10, 2007 10:52 AM
  • User764555827 posted

    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 it.

    Know what? It'd would be kind of you to mark my posts as "Answers" if they helped you... 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 10, 2007 11:28 AM