locked
Localization: using DLL's instead of resource files RRS feed

  • Question

  • User-380520913 posted

    Dear all,

    I recently started experimenting with locaization and my first multilingual website. It was hard at first but thanks to this tutorial I finally got it: http://www.vbdotnetheaven.com/UploadFile/mosessaur/aspnetlocalization02072006035253AM/aspnetlocalization.aspx

    The only thing is that the turtorial doesn't cover is how I can use DLL's rather than the App_GlobalResources folder. I've been asked to group
    all these DLL's in a subdirectory in the 'bin' folder. OR, is the method of using DLL's depreciated? I'm using VS 2008 now instead of VS 2003.

     Hope this note finds you well.

     Best!

    Wednesday, December 17, 2008 2:16 AM

Answers

  • User1439985827 posted

    It's still a very popular method, it's called satellite assemblies. It's tricky if you are using a Web Site, not a Web Application because Web Site's aren't compiled into DLLs before loading. You can read more about satellite assemblies here though:

    http://msdn.microsoft.com/en-us/library/21a15yht.aspx

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 17, 2008 1:40 PM

All replies

  • User1439985827 posted

    It's still a very popular method, it's called satellite assemblies. It's tricky if you are using a Web Site, not a Web Application because Web Site's aren't compiled into DLLs before loading. You can read more about satellite assemblies here though:

    http://msdn.microsoft.com/en-us/library/21a15yht.aspx

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 17, 2008 1:40 PM
  • User-380520913 posted

    Thanks Kevin!  

    It looks like a great article so I'll look futher into it. I actually prefer webapplications aswell so my whole site is in an DLL.

    Do you have an idea perhaps how I can create the DLL's "inside" Visual Studio?

    Thanks again!

    Thursday, December 18, 2008 7:49 AM
  • User-604409662 posted

     HEY i have the same problem am trying to localize using dll files and not resource files ...any help would be appreciated..i feel its kinda old way of localizing but its my supervisors recommendation.......help :-(

    Tuesday, August 25, 2009 10:29 AM
  • User-380520913 posted

    Hi Kevin, Thanks!

    Now that the project I am working on is coming to an end the whole  DLL's vs App_GlobalResources discussion is becoming hot again and I'd like to know the pros and cons of the 2 methods.

    Right now I'm still using the App_GlobalResources and this particular folder contains 3 files: Language.resx (contains empty labels), Languages.fr.resx (Labels+French) and Languages.en.resx (Labels+English).

    In my code I set objects like labels and such like this:
    lblTitle.Text = Resources.Language.sToday (which results in either "Aujourd'hui" or "Today")

    To switch cultures I have a method call SwitchCulture and it changes my langauges:

    Public Shared Sub SwitchCulture(ByRef objPage As System.Web.UI.Page, ByVal sLanguage As String)
       ' objPage = aspx page
       ' sLanguage = string like "fr-fr" or "us-en"

       objPage.UICulture = sLanguage
       objPage.Culture = sLanguage

       Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(sLanguage)    
       Thread.CurrentThread.CurrentUICulture =
    New CultureInfo(sLanguage)
    End Sub

    Right now it works great with App_GLobalResources, but when I try to try to embed the resources - "Embed Resources" instead of "Content" my application asks for the App_GlobalResources. However the subdirectories containing dll's doe get created in mmy bin directory:
    "bin/fr/Language.resources.dll" and "bin/en/Language.resources.dll".

    Does anyone know what I'm missing here?

    Kind Regards!

    Wednesday, November 11, 2009 9:47 AM