Installing more cultures on Windows Server 2012

孤者浪人 提交于 2019-12-04 09:28:52

Here's some Powershell I've used to add custom cultures to 2012. This is a hard-coded script (sorry, rough!). It bases a new culture ($newCulture) on an existing one, in this case en-US.

This is based on sample C# code from MSDN, under "How To: Create Custom Cultures": https://msdn.microsoft.com/en-us/library/ms172469(v=vs.100).aspx

Hope it helps!

###################################
# 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"
}

The fix is to upgrade the OS of the machine running your system. As documented here...

https://docs.microsoft.com/en-gb/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c

en-HK is supported in "Release 8.1"

Release 8.1 correlates to "Windows 8.1 and Windows Server 2012 R2. Supported in all later versions."

So yes you will see en-HK on Windows 8.1 to see it on your server install the R2 service pack.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!