I try to write simple C# project to test how localication work. I did how here is written.
I think I use the same like in the questions/1142802. But it doesn't work in my Demo project. I can't explain why. This is why I attached Demo project.
I have two resource files for FRA and RUS languages.
And try to switch language using next code
private void rbFra_Click(object sender, EventArgs e)
{
System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo("fr-Fr");
Thread.CurrentThread.CurrentUICulture = cultureInfo;
Thread.CurrentThread.CurrentCulture = cultureInfo;
textBox1.Text = Properties.Resources.String1;
}
private void rgEng_Click(object sender, EventArgs e)
{
System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo("en-US");
Thread.CurrentThread.CurrentUICulture = cultureInfo;
Thread.CurrentThread.CurrentCulture = cultureInfo;
textBox1.Text = Properties.Resources.String1;
}
private void rbRus_Click(object sender, EventArgs e)
{
System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo("ru-RU");
Thread.CurrentThread.CurrentUICulture = cultureInfo;
Thread.CurrentThread.CurrentCulture = cultureInfo;
textBox1.Text = Properties.Resources.String1;
}
But the result is always in English.
I think that Thread.CurrentThread.CurrentUICulture = ... should force to reload resource file and String1 return text from loaded resource.
Here is the DemoProject https://yadi.sk/d/4zEWVhso3Q4eqV