更改语言在C#语言

由网友(抽完马桶我就遇见了你@)分享简介:我在Windows上开发一个多语言的程序在C#I am developing a multilingual program in C# on Windows如何更改某些操作的Windows书写语言...例如从英语更改为阿拉伯语的焦点事件。How to change Windows writing languag...

我在Windows上开发一个多语言的程序在C#

I am developing a multilingual program in C# on Windows

如何更改某些操作的Windows书写语言... 例如从英语更改为阿拉伯语的焦点事件。

How to change Windows writing language on certain actions... e.g. to change from English to Arabic on focus event.

感谢

推荐答案

要选择一个全新的文化,将 CurrentThread.CurrentCulture 来一个新的文化,如:要设置为法语:

To select a whole new culture, set the CurrentThread.CurrentCulture to a new culture, e.g. to set to French:

System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("fr-FR");
System.Threading.Thread.CurrentThread.CurrentCulture = ci;

您可以找到pdefined的$ P $ 的CultureInfo 名称here.

You can find a list of the predefined CultureInfo names here.

如果要更改默认的文化的某些方面,你可以抓住当前线程的文化,使用它的名字来创建一个新的CultureInfo实例,并设置线程的新的文化有了一些变化,例如:改变当前区域性使用'欧元'符号:

If you want to change certain aspects of the default culture, you can grab the current thread's culture, use it it's name to create a new CultureInfo instance and set the thread's new culture with some changes, e.g. to change the current culture to use the 'Euro' symbol:

System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo( System.Threading.Thread.CurrentThread.CurrentCulture.Name);
ci.NumberFormat.CurrencySymbol = "€";
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
阅读全文

相关推荐

最新文章