CultureInfo.ThreeLetterWindowsLanguageName Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the three-letter code for the language as defined in the Windows API.
public:
virtual property System::String ^ ThreeLetterWindowsLanguageName { System::String ^ get(); };
public virtual string ThreeLetterWindowsLanguageName { get; }
member this.ThreeLetterWindowsLanguageName : string
Public Overridable ReadOnly Property ThreeLetterWindowsLanguageName As String
Property Value
The three-letter code for the language as defined in the Windows API.
Examples
The following code example displays several properties of the neutral cultures.
Note
The zh-Hans
and zh-Hant
names represent the current standard for Chinese cultures. Older applications might reference the legacy zh-CHS
and zh-CHT
culture names, but these should be replaced with zh-Hans
and zh-Hant
respectively in modern applications.
using System;
using System.Globalization;
public class SamplesCultureInfo
{
public static void Main()
{
// Displays several properties of the neutral cultures.
Console.WriteLine("CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME");
foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.NeutralCultures))
{
Console.Write("{0,-7}", ci.Name);
Console.Write(" {0,-3}", ci.TwoLetterISOLanguageName);
Console.Write(" {0,-3}", ci.ThreeLetterISOLanguageName);
Console.Write(" {0,-3}", ci.ThreeLetterWindowsLanguageName);
Console.Write(" {0,-40}", ci.DisplayName);
Console.WriteLine(" {0,-40}", ci.EnglishName);
}
}
}
/*
This code produces the following output. This output has been cropped for brevity.
CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME
ar ar ara ARA Arabic Arabic
bg bg bul BGR Bulgarian Bulgarian
ca ca cat CAT Catalan Catalan
cs cs ces CSY Czech Czech
da da dan DAN Danish Danish
de de deu DEU German German
el el ell ELL Greek Greek
en en eng ENU English English
es es spa ESP Spanish Spanish
fi fi fin FIN Finnish Finnish
zh zh zho CHS Chinese Chinese
zh-Hans zh zho CHS Chinese (Simplified) Chinese (Simplified)
zh-Hant zh zho ZHH Chinese (Traditional) Chinese (Traditional)
Note: zh-Hant returns ZHH when using ICU (default). When NLS mode is enabled, it returns CHT.
*/
' Displays several properties of the neutral cultures.
Console.WriteLine("CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME")
Dim ci As CultureInfo
For Each ci In CultureInfo.GetCultures(CultureTypes.NeutralCultures)
Console.Write("{0,-7}", ci.Name)
Console.Write(" {0,-3}", ci.TwoLetterISOLanguageName)
Console.Write(" {0,-3}", ci.ThreeLetterISOLanguageName)
Console.Write(" {0,-3}", ci.ThreeLetterWindowsLanguageName)
Console.Write(" {0,-40}", ci.DisplayName)
Console.WriteLine(" {0,-40}", ci.EnglishName)
Next ci
'This code produces the following output. This output has been cropped for brevity.
'
'CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME
'ar ar ara ARA Arabic Arabic
'bg bg bul BGR Bulgarian Bulgarian
'ca ca cat CAT Catalan Catalan
'cs cs ces CSY Czech Czech
'da da dan DAN Danish Danish
'de de deu DEU German German
'el el ell ELL Greek Greek
'en en eng ENU English English
'es es spa ESP Spanish Spanish
'fi fi fin FIN Finnish Finnish
'zh zh zho CHS Chinese Chinese
'zh-Hans zh zho CHS Chinese (Simplified) Chinese (Simplified)
'zh-Hant zh zho ZHH Chinese (Traditional) Chinese (Traditional)
'
'Note: zh-Hant returns ZHH when using ICU (default). When NLS mode is enabled, it returns CHT.
Remarks
This property returns the same value as the Windows API method GetLocaleInfo
with the LOCALE_SABBREVLANGNAME value. For example, the three-letter code for English (United States) as defined in the Windows API is "enu".
Note
When communicating between processes or persisting data it is usually better to use the full CultureInfo.Name. Using just the language can lose context and data.