如何在c#windows应用程序中使用区域语言

问题描述:

我想在我的c#windows应用程序中使用像(kannada,hindi)这样的区域语言,所以如果您有任何想法,我希望得到您的帮助,请帮助我....

谢谢... ..

I want to use regional language like(kannada, hindi)in my c# windows application, so I want your help if you have any idea please help me....
Thank You....

如果您只是想将您的应用程序与不同语言的数据一起使用,则无需做任何事情:.NET支持Unicode,因此所有语言你提到的已经支持,以及许多其他人。



如果你想用任何一种语言编写UI,情况是一样的。



但是,如果您希望能够切换UI以便应用程序能够以用户支持的语言显示UI,那就更难了:您需要全球化你的应用程序(即使它已经是英文版,你应该删除所有使你的代码文化依赖的东西;实际上,它主要意味着将所有立即常量移动到资源;但你的UI也应该是流畅的,所以布局不应该被不同长度的字符串所破坏)然后你可以将它本地化到你想要介绍的语言,可能是一个接一个。



您还可以在运行时切换应用程序的文化,并且将自动找到本地化资源(或者由于特殊的后备机制而最接近所请求的文化,并且刷新的UI将展示不同的文化。



请参阅:

http://msdn.microsoft.com/en-us/library/h6270d0z.aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/aa291552%28v=vs.71%29.aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/ms788718.aspx [ ^ ],

http://msdn.microsoft.com/en-us/library /vstudio/dd997383%28v=vs.100%29.aspx [ ^ ]。



另见我过去的答案:

winform .net 中的全球化/本地化问题[ ^ ],

winforms中的全球化 [ ^ ]。



-SA
If you simply want to use your application with data in different language, there is nothing to do about it: .NET supports Unicode, so all the languages you mentioned are already supported, as well as many others.

If you want to write UI in any of these languages, the situation is the same.

However, if you want to be able switch you UI so the application would be able to show UI in the language supported by the user, it''s a bit more difficult: you need to globalize you application (even though it is already in English, you should remove everything which makes your code culture-dependent; practically, it mostly means moving all immediate constants to resources; but your UI should also be fluid, so layout should not be mangled by different lengths of strings) and then you can localize it to languages you want to introduce, possibly one by one.

You can also switch the culture of the application during run-time, and the localized resource will be automatically found (or the closest to the requested culture, due to a special fallback mechanism, and refreshed UI will show a different culture.

Please see:
http://msdn.microsoft.com/en-us/library/h6270d0z.aspx[^],
http://msdn.microsoft.com/en-us/library/aa291552%28v=vs.71%29.aspx[^],
http://msdn.microsoft.com/en-us/library/ms788718.aspx[^],
http://msdn.microsoft.com/en-us/library/vstudio/dd997383%28v=vs.100%29.aspx[^].

See also my past answers:
globalization/localization problem in winform .net[^],
globalization in winforms[^].

—SA