Click here to Skip to main content
15,894,291 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:


I have my solution set up with one form (Form1). I have one text box in the form (textBox1). I have a folder in the Solution for the satellite assembly to go (de-DE). I have run the resgen as follows:
resgen Form1.resx de-DE\Form1.de-DE.resx
this is to duplicate the form resource file into that folder.
I have run the resgen again from there to create the .resources file and from that run the assembly linker. I am trying to get the program to pull the resources from the de-DE folder based on the CurrentCulture setting being at de-DE. But I am not getting anywhere with it. Any thoughts?
Posted
Updated 28-Jul-10 10:46am
v2

You don't need to pull anything from your side. Have a look at these articles to see how things are handled in localization. It's simple current thread based.
Localizing a Windows Application with Satellite Assemblies[^]
Globalization and localization demystified in ASP.NET 2.0[^]
 
Share this answer
 
Comments
BUnderwood 28-Jul-10 13:37pm    
But I still don't see how this will modify the resources on Form1 particularly. As well as this route is being forced on me from above.
Sandeep Mewara 28-Jul-10 13:39pm    
Creating resource was fine what you did. Thing is once you have proper resources, you don't need to explicitly force form to pick particular resource. Just specify the thread culture and .NET will automatically take care of it.
BUnderwood 28-Jul-10 15:02pm    
That is what I thought too, but it is not doing so. Any ideas why. Do you have a way that I could zip you the file?
Try this:
C#
public static void SetCulture(string culture)
{
    try
    {
        Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(culture);
    }
    catch
    {
        Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
    }
}

Just give culture = "de-DE".
 
Share this answer
 
v2
Comments
BUnderwood 28-Jul-10 16:34pm    
Thanks, but that did not change things.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900