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. General Programming
  3. C#
  4. Editing resource files for different languages, string don't persist

Editing resource files for different languages, string don't persist

Scheduled Pinned Locked Moved C#
visual-studioquestionlearning
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.
  • S Offline
    S Offline
    steve_rm
    wrote on last edited by
    #1

    Hello VS 2008 I have a resource file called Form1.fr-FR.resx which has been added to my project when I set the local and language of the form. In my Form1.fr-FR.resx I have button1.Text, button2.Text. I have set the culture to fr-FR so when the form starts its displays the french language in the buttons. However, I would like to include some string of my own in this file. I have added strName, strAddress as I want to display these in a message box. However, when I add more control to the form the string I have added get deleted. When I open the Form1.fr-FR.resx using edit plus the string are there. However, when I try and display them, I just get a blank. Is there some reason that the strings don't persist in the resource file? Some code that I am using: Dim rm As New ResourceManager("LanCulture.Form1", Me.[GetType]().Assembly) Console.WriteLine(rm.GetString("strName", Thread.CurrentThread.CurrentUICulture)) Many thanks for any advice on this,

    M 1 Reply Last reply
    0
    • S steve_rm

      Hello VS 2008 I have a resource file called Form1.fr-FR.resx which has been added to my project when I set the local and language of the form. In my Form1.fr-FR.resx I have button1.Text, button2.Text. I have set the culture to fr-FR so when the form starts its displays the french language in the buttons. However, I would like to include some string of my own in this file. I have added strName, strAddress as I want to display these in a message box. However, when I add more control to the form the string I have added get deleted. When I open the Form1.fr-FR.resx using edit plus the string are there. However, when I try and display them, I just get a blank. Is there some reason that the strings don't persist in the resource file? Some code that I am using: Dim rm As New ResourceManager("LanCulture.Form1", Me.[GetType]().Assembly) Console.WriteLine(rm.GetString("strName", Thread.CurrentThread.CurrentUICulture)) Many thanks for any advice on this,

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      steve_rm wrote:

      Dim rm As New ResourceManager("LanCulture.Form1", Me.[GetType]().Assembly)

      This is C# forum.

      Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      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