Editing resource files for different languages, string don't persist
-
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, -
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,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.