CultureInfo.ThreeLetterWindowsLanguageName Propriedade
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Obtém o código de três letras do idioma, conforme definido na API do Windows.
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
Valor da propriedade
O código de três letras do idioma, conforme definido na API do Windows.
Exemplos
O exemplo de código a seguir exibe várias propriedades das culturas neutras.
Observação
O exemplo exibe os nomes de cultura e zh-CHT
mais antigos zh-CHS
com os identificadores de cultura 0x0004 e 0x7C04, respectivamente. No entanto, seus aplicativos do Windows Vista devem usar o zh-Hans
nome em vez de zh-CHS e o zh-Hant
nome em vez de zh-CHT. Os zh-Hans
nomes e zh-Hant
representam o padrão atual e devem ser usados, a menos que você tenha um motivo para usar os nomes mais antigos.
using namespace System;
using namespace System::Globalization;
int main()
{
// Displays several properties of the neutral cultures.
Console::WriteLine( "CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME" );
System::Collections::IEnumerator^ enum0 = CultureInfo::GetCultures( CultureTypes::NeutralCultures )->GetEnumerator();
while ( enum0->MoveNext() )
{
CultureInfo^ ci = safe_cast<CultureInfo^>(enum0->Current);
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
zh-Hans zh zho CHS Chinese (Simplified) Chinese (Simplified)
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-Hant zh zho CHT Chinese (Traditional) Chinese (Traditional)
zh-CHS zh zho CHS Chinese (Simplified) Legacy Chinese (Simplified) Legacy
zh-CHT zh zho CHT Chinese (Traditional) Legacy Chinese (Traditional) Legacy
*/
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
zh-Hans zh zho CHS Chinese (Simplified) Chinese (Simplified)
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-Hant zh zho CHT Chinese (Traditional) Chinese (Traditional)
zh-CHS zh zho CHS Chinese (Simplified) Legacy Chinese (Simplified) Legacy
zh-CHT zh zho CHT Chinese (Traditional) Legacy Chinese (Traditional) Legacy
*/
Imports System.Globalization
Module Module1
Public Sub Main()
' 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
End Sub
'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
'zh-Hans zh zho CHS Chinese (Simplified) Chinese (Simplified)
'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-Hant zh zho CHT Chinese (Traditional) Chinese (Traditional)
'zh-CHS zh zho CHS Chinese (Simplified) Legacy Chinese (Simplified) Legacy
'zh-CHT zh zho CHT Chinese (Traditional) Legacy Chinese (Traditional) Legacy
End Module
Comentários
Essa propriedade retorna o mesmo valor que o método GetLocaleInfo
da API do Windows com o valor LOCALE_SABBREVLANGNAME. Por exemplo, o código de três letras para inglês (Estados Unidos) conforme definido na API do Windows é "enu".
Observação
Ao se comunicar entre processos ou dados persistentes, geralmente é melhor usar o completo CultureInfo.Name. Usar apenas o idioma pode perder contexto e dados.