How to troubleshoot .net WinForm dialog localization

I have created a dialog box under Visual Studio .NET in C#/Winforms that must support multiple languages. I have set the dialog Localizable property to True, then selected the neutral Language - French and entered the French text in the dialog, as well as French (France). I see the associated resource files:

AboutBox.fr-FR.resx
AboutBox.fr.resx
AboutBox.resx

To test it, I set the thread CurrentCulture and CurrentUICulture to CultureInfo("fr-FR") in the main thread as shown below, then created the dialog box, but only the English version shows. I verified that the thread CurrentCulture and CurrentUICulture were still set to "fr-FR" during the dialog constructor.

            CultureInfo cultureInfo = new CultureInfo("fr-FR");
            Thread.CurrentThread.CurrentCulture = cultureInfo;
            Thread.CurrentThread.CurrentUICulture = cultureInfo;

The overall Neutral language for the assembly is English-US.

I cannot see any useful messages in the output window. What is the best way to track down the reasons for .NET localization runtime behavior?


It turns out that there was C# code behind overriding the designer fields with English text. I was trying to run a quick test before finishing the rest of the translations.

链接地址: http://www.djcxy.com/p/95378.html

上一篇: 在C#应用程序中更改“(默认)”ResX语言

下一篇: 如何解决.net WinForm对话本地化问题