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. resource file(Urgent)

resource file(Urgent)

Scheduled Pinned Locked Moved ASP.NET
tutoriallearning
2 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.
  • B Offline
    B Offline
    brindhavijay
    wrote on last edited by
    #1

    i need idea or code for apply the localization in my application start.I have two .Resx file.The first one is Default language(EN).The another one Tamil(ta).How to apply the localization in my appliacation page load or Application start event. fdsfdsfdsfsdfdsfdsf

    V 1 Reply Last reply
    0
    • B brindhavijay

      i need idea or code for apply the localization in my application start.I have two .Resx file.The first one is Default language(EN).The another one Tamil(ta).How to apply the localization in my appliacation page load or Application start event. fdsfdsfdsfsdfdsfdsf

      V Offline
      V Offline
      Vimal Raj
      wrote on last edited by
      #2

      Hi, The resx file must follow the naming convention basefilename.locale.resx ie myFile.en-US.resx Then you have to generate the .resources file with the resgen utility resgen filename.locale.resx which will give you filename.locale.resources file Then you have to create the satellite assembly using the AL command AL /t:lib /culture:locale /embed:filename.locale.resources /out:ResourcesDemo.resources.dll The /t switch tells that the output is of type library (DLL). The culture switch tells that the resources being embedded in the assembly are for the specified culture(/culture:en-US). /embed switch specifies the .resources file that is to be embedded in the Satellite Assembly. Finally, /out switch specifies the name of output assembly. if your Satellite Assembly is for culture en-US then you need to create a folder called en-US inside the bin folder and place the Satellite Assembly there. To read from the resource file you can use code like this. Dim rMngr As ResourceManager Dim ci As New CultureInfo("en-US") Thread.CurrentThread.CurrentCulture = ci rMngr = New ResourceManager("filename.locale",[Assembly].GetExecutingAssembly.GetSatelliteAssembly(ci)) Label1.Text=x.GetString("myLabel") for this you need a label control and a resource item myLabel. The code Dim ci As New CultureInfo("en-US") Thread.CurrentThread.CurrentCulture = ci is used to test the culture information. to use the local culture info you can use ci=Thread.CurrentThread.CurrentCulture Hope this is of some use to you Happy Programming, Vimal

      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