CultureInfo.DisplayName プロパティ
ローカライズされた .NET Framework の言語で表した "<languagefull> (<country/regionfull>)" という形式のカルチャ名を取得します。
Public Overridable ReadOnly Property DisplayName As String
[C#]
public virtual string DisplayName {get;}
[C++]
public: __property virtual String* get_DisplayName();
[JScript]
public function get DisplayName() : String;
プロパティ値
ローカライズされた .NET Framework の言語で表した "<languagefull> (<country/regionfull>)" という形式のカルチャ名。<languagefull> は言語の完全名であり、<country/regionfull> は国/地域の完全名です。
解説
たとえば、英語版の .NET Framework をインストールした場合、特定のカルチャ、米国の英語の DisplayName は "English (United States)" となります。スペイン語版の .NET Framework をインストールした場合、設定されている表示言語にかかわらず、カルチャ名はスペイン語で表示されます。したがって、特定のカルチャ、米国の英語の DisplayName は "Ingles (Estados Unidos)" となります。
使用例
[Visual Basic, C#, C++] ニュートラル カルチャのプロパティ値のいくつかを表示するコード例を次に示します。
Imports System
Imports System.Globalization
Public Class SamplesCultureInfo
Public Shared 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 'Main
End Class 'SamplesCultureInfo
'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-CHS zh zho CHS Chinese (Simplified) Chinese (Simplified)
'zh-CHT zh zho CHT Chinese (Traditional) Chinese (Traditional)
'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
[C#]
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-CHS zh zho CHS Chinese (Simplified) Chinese (Simplified)
zh-CHT zh zho CHT Chinese (Traditional) Chinese (Traditional)
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
*/
[C++]
#using <mscorlib.dll>
using namespace System;
using namespace System::Globalization;
int main() {
// Displays several properties of the neutral cultures.
Console::WriteLine( S"CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME" );
System::Collections::IEnumerator* enum0 = CultureInfo::GetCultures(CultureTypes::NeutralCultures)->GetEnumerator();
while (enum0->MoveNext())
{
CultureInfo* ci = __try_cast<CultureInfo*>(enum0->Current);
Console::Write( S"{0,-7}", ci->Name );
Console::Write( S" {0,-3}", ci->TwoLetterISOLanguageName );
Console::Write( S" {0,-3}", ci->ThreeLetterISOLanguageName );
Console::Write( S" {0,-3}", ci->ThreeLetterWindowsLanguageName );
Console::Write( S" {0,-40}", ci->DisplayName );
Console::WriteLine( S" {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-CHS zh zho CHS Chinese (Simplified) Chinese (Simplified)
zh-CHT zh zho CHT Chinese (Traditional) Chinese (Traditional)
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
*/
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
CultureInfo クラス | CultureInfo メンバ | System.Globalization 名前空間 | Name | NativeName | EnglishName | TwoLetterISOLanguageName | ThreeLetterISOLanguageName | ThreeLetterWindowsLanguageName