在Windows Server 2012上安装更多文化

在Windows 8.1计算机上,我看到的文化比Windows Server 2012计算机上的文化要多得多:791对比378.举一个具体的例子,服务器机器缺少’en-HK’文化。

这是我用来枚举它们的测试代码:

foreach (var ci in CultureInfo.GetCultures(System.Globalization.CultureTypes.AllCultures).OrderBy(ci => ci.Name)) { Console.WriteLine("{0} ({1})", ci.Name, ci.EnglishName); } 

问题:如何在Windows Server 2012上安装更完整的区域性列表,以使其与Windows 8.1上的可用文档列表相匹配?

这是我用于向2012年添加自定义文化的一些Powershell。这是一个硬编码的脚本(对不起,粗糙!)。 它将新文化( $newCulture )建立在现有文化上,在本例中为en-US。

这是基于MSDN的示例C#代码,在“如何:创建自定义文化”下: https : //msdn.microsoft.com/en-us/library/ms172469(v = vs.100) .aspx

希望能帮助到你!

 ################################### # Add-Culture # # Edit script to add a new custom culture # ################################### function Add-Culture($Servers, $Credential) { Invoke-Command { # Import System.Globalization Add-Type -AssemblyName "sysglobl" $newCulture = "en-TH" # Create new CultureAndRegionInfoBuilder $cib = New-Object "System.Globalization.CultureAndRegionInfoBuilder" -Args $newCulture, None # Based on existing en-US culture $ci = New-Object "System.Globalization.CultureInfo" -Args "en-US" $ri = New-Object "System.Globalization.RegionInfo" -Args "th-TH" $cib.LoadDataFromCultureInfo($ci) $cib.LoadDataFromRegionInfo($ri) # Set culture values here # Naming $cib.CultureEnglishName = "English (Thailand)" $cib.CultureNativeName = "English (Thailand)" $cib.IetfLanguageTag = $newCulture # RegionInfo $cib.RegionEnglishName = "Thailand" $cib.RegionNativeName = "Thailand" # ISO $cib.ThreeLetterISOLanguageName = "eng" $cib.ThreeLetterWindowsLanguageName = "ENG" $cib.TwoLetterISOLanguageName = "en" $cib.ThreeLetterISORegionName = "THA" $cib.TwoLetterISORegionName = "TH" $cib.ThreeLetterISORegionName = "THA" $cib.ThreeLetterWindowsRegionName = "THA" # Currency $cib.ISOCurrencySymbol = "THB" $cib.CurrencyEnglishName = "Thai Baht" $cib.CurrencyNativeName = "Thai Baht" $cib.NumberFormat.CurrencySymbol = "฿" # Dates $cib.GregorianDateTimeFormat.ShortDatePattern = "d/M/yyyy"; # Print values Write-Verbose ($cib | Format-List | Out-String) Write-Verbose ($cib.GregorianDateTimeFormat | Format-List | Out-String) Write-Verbose ($cib.NumberFormat | Format-List | Out-String) $cib.Register(); } -ComputerName $Servers -Credential $Credential Write-Output "Registered new culture $newCulture on $servers" }