开发者

how to force a localizable WinForms app to use the (default) Language property

开发者 https://www.devze.com 2023-02-07 21:25 出处:网络
I have a WinForms app in 4 different languages. The whole app was written i开发者_开发知识库n English, but I never set the Localization to en, or en-US. Is there a way to use to force the Language pro

I have a WinForms app in 4 different languages. The whole app was written i开发者_开发知识库n English, but I never set the Localization to en, or en-US. Is there a way to use to force the Language property to (default) from code. For instance, let's say that the current thread is in Portuguese, I close all forms, change the CultuInfo of the current thread to use the (default) language and reload all forms again. Is there a way o doing that?

Thanks


I guess you are searching for the NeutralResourcesLanguage class. You use this attribute in your AssemblyInfo.cs file to set the default culture of an application:

[assembly: NeutralResourcesLanguage("en-US")]

Hope that helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消