jjzjj

CurrentUICulture

全部标签

wpf - 我们是否需要安装 os 语言包来本地化 wpf 应用程序?

我有一个使用全局化功能实现的WPF应用程序。它使用卫星程序集来获取本地化资源。我更改了区域和语言设置。System.Threading.CurrentThread.CurrentCulture已更改但未设置CurrentUICulture。必须安装os语言包吗?或者是否有其他配置设置?谢谢 最佳答案 嗯,我想唯一的解决办法是根据CultureInfo.InstalledUICulture设置Thread.Current.CurrentUICulture,例如Application.OnStartUp方法。请看看这个SOpost还有这

c# - 更改 DateTimePicker 日历运行时

我想在另一种文化中查看日历,例如让它显示在阿拉伯。我在Main中使用此代码,但日历仍在同一位置文化:CultureInfosa=newCultureInfo("ar-SA",false);sa.DateTimeFormat.Calendar=newSystem.Globalization.HijriCalendar();//SetstheculturetoArabic(SaudiArabia)Thread.CurrentThread.CurrentCulture=sa;//SetstheUIculturetoArabic(SaudiArabia)Thread.CurrentThread

c# - ASP.NET MVC(异步)CurrentCulture 不在 Controller 和 View 之间共享

我有一个以.NETFramework4.7.1为目标的ASP.NETMVC4应用程序,如果操作包含异步调用,则存在文化在Controller和View之间不共享的问题。我正在引用NuGet包Microsoft.AspNet.Mvc5.2.3(并且可以在5.2.4中复制)。这是Controller中的代码:publicclassCulturesTestController:Controller{publicasyncTaskIndex(stringvalue){Thread.CurrentThread.CurrentCulture=CultureInfo.GetCultureInfo("

c# - 为国家、语言组合创建自定义 CultureInfo

我正在开发一个.net4.5应用程序,它需要多语言支持多文化等。以下是国家/语言的示例列表俄罗斯/俄语比利时/法语比利时/荷兰对于以上所有内容,有一个CultureInfo对象可以根据上述文化名称创建ru-rufr-BEnl-BE当用户进入该站点时,我将Thread.CurrentThread.CurrentCulture和Thread.CurrentThread.CurrentUICulture设置为使用上述名称创建的区域性,例如。Thread.CurrentThread.CurrentCulture=newCultureInfo("nl-BE",false)Thread.Curre

c# - WPF:如何在运行时更改 CurrentUICulture

我正在尝试更改我的WPF应用程序在点击事件中使用的语言,但它没有改变。privatevoidmenuItemGerman_Click(objectsender,RoutedEventArgse){Settings.Default.Culture="de-DE";Thread.CurrentThread.CurrentCulture=newCultureInfo(Settings.Default.Culture);Thread.CurrentThread.CurrentUICulture=newCultureInfo(Settings.Default.Culture);}我错过了什么?

c# - 使用 DateTime.ToString ("tt"时,Windows 10 中的时间输出(AM/PM)发生了变化)

我最近升级到Windows10-现在我发现在使用“tt”格式说明符时日期的输出发生了一些意想不到的变化。下面是一些演示问题的代码:usingSystem.IO;usingSystem;usingSystem.Globalization;usingSystem.Threading.Tasks;classProgram{staticvoidMain(){varcultures=newstring[]{null,"en-NZ","en-US","en-AU","en-GB"};foreach(varcultureincultures){if(culture!=null){varc=Cultu

c# - 为什么 CurrentUICulture 是 "DE-DE",即使我在 Windows 中设置了 "DE-CH"

在我的WPF应用程序中,CurrentUICulture未被Windows正确接管或错误地存储在Windows中。Windows中的区域和语言设置在我找到“Deutsch(Schweiz)”的所有地方。应用程序中的CurrentUICulture显示“Deutsch(Deutschland)”而不是“Deutsch(Schweiz)”。我已经在几台计算机上测试过它(域用户和本地用户)。问题出在哪里?Windows中是否有很难找到此设置的位置?重要提示:我知道我可以在应用程序中设置文化。我不需要像Thread.CurrentThread.CurrentUICulture=newCultu