Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Localization and satellite assemblies

Localization and satellite assemblies

Scheduled Pinned Locked Moved ASP.NET
helpquestioncsharpvisual-studiotutorial
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Krugger404
    wrote on last edited by
    #1

    Hi, I am currently building a web application whereby translation is being catered by resource files. For some reasons, it is required that each web page in the site have it own resource files. Thus, for a given page, page say "PageTest", there will be two resource files "PageTest.en-gb.resx" and "PageTest.fr-fr.resx" (provided that only two languages are defined for the time being). This process extends to all pages in the site. I store all the resource files in single folder such that i have : Resources\Page1Test.en-gb.resx Resources\Page1Test.fr-fr.resx Resources\Page2Test.en-gb.resx Resources\Page2Test.fr-fr.resx etc.... Visual Studio nicely builds two DLL (satellite assemblies) in the bin folder of my application as follows : bin\en-gb\Web.Resources.DLL --> This folder contains all resources files in english (ie. Resources\Page1Test.en-gb.resx , Resources\Page2Test.en-gb.resx etc..) bin\fr-fr\Web.Resources.DLL --> This folder contains all resources files in french (ie. Resources\Page1Test.fr-fr.resx , Resources\Page2Test.fr-fr.resx) So far so good. The problem here is that i have no idea how to reference a specific resource found in a specific resource file of the satellite assembly. Clearly speaking, How can i distinguish between en-gb\Web.Resources.DLL --> Page1Test."Resource_key" and en-gb\Web.Resources.DLL --> Page2Test."Resource_key" where "Resource_key" is a simple key to retrieve a string? Can you please help me on this point? Thank you.

    N 1 Reply Last reply
    0
    • K Krugger404

      Hi, I am currently building a web application whereby translation is being catered by resource files. For some reasons, it is required that each web page in the site have it own resource files. Thus, for a given page, page say "PageTest", there will be two resource files "PageTest.en-gb.resx" and "PageTest.fr-fr.resx" (provided that only two languages are defined for the time being). This process extends to all pages in the site. I store all the resource files in single folder such that i have : Resources\Page1Test.en-gb.resx Resources\Page1Test.fr-fr.resx Resources\Page2Test.en-gb.resx Resources\Page2Test.fr-fr.resx etc.... Visual Studio nicely builds two DLL (satellite assemblies) in the bin folder of my application as follows : bin\en-gb\Web.Resources.DLL --> This folder contains all resources files in english (ie. Resources\Page1Test.en-gb.resx , Resources\Page2Test.en-gb.resx etc..) bin\fr-fr\Web.Resources.DLL --> This folder contains all resources files in french (ie. Resources\Page1Test.fr-fr.resx , Resources\Page2Test.fr-fr.resx) So far so good. The problem here is that i have no idea how to reference a specific resource found in a specific resource file of the satellite assembly. Clearly speaking, How can i distinguish between en-gb\Web.Resources.DLL --> Page1Test."Resource_key" and en-gb\Web.Resources.DLL --> Page2Test."Resource_key" where "Resource_key" is a simple key to retrieve a string? Can you please help me on this point? Thank you.

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      " i have no idea how to reference a specific resource found in a specific resource file of the satellite assembly." You don't need to. The framework will access the proper resource file for the language being used, all you need to do is reference the resource key.


      only two letters away from being an asset

      K 1 Reply Last reply
      0
      • N Not Active

        " i have no idea how to reference a specific resource found in a specific resource file of the satellite assembly." You don't need to. The framework will access the proper resource file for the language being used, all you need to do is reference the resource key.


        only two letters away from being an asset

        K Offline
        K Offline
        Krugger404
        wrote on last edited by
        #3

        Thanks. The thing is that the resource key can be available in different resource files contained in the satellite assembly. I need an access means to ensure that if i want Web.Resources.DLL -> Page1Test.en-gb->"Page title", then i will not get Web.Resources.DLL -> Page2Test.en-gb->"Page title" instead. Can you please help? Thanks

        N 1 Reply Last reply
        0
        • K Krugger404

          Thanks. The thing is that the resource key can be available in different resource files contained in the satellite assembly. I need an access means to ensure that if i want Web.Resources.DLL -> Page1Test.en-gb->"Page title", then i will not get Web.Resources.DLL -> Page2Test.en-gb->"Page title" instead. Can you please help? Thanks

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          Global resources http://msdn2.microsoft.com/en-us/library/ms227427.aspx[^]


          only two letters away from being an asset

          K 1 Reply Last reply
          0
          • N Not Active

            Global resources http://msdn2.microsoft.com/en-us/library/ms227427.aspx[^]


            only two letters away from being an asset

            K Offline
            K Offline
            Krugger404
            wrote on last edited by
            #5

            Thanks Mark Nischalke, based on the MSDN link and a bunch of other articles, i managed to access a specific resource, in a specific resource file of a Satellite Assembly. The syntax is as simple as this : ResourceManager _resManager = new ResourceManager([Name of Satellite Assembly]+ "." + [Name of resource file embedded] + "." + [Culture name], Assembly.GetExecutingAssembly().GetSatelliteAssembly(_culture)); Thanks again.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups