CultureInfo.Name プロパティ

定義

languagecode2-country/regioncode2 という形式のカルチャ名を取得します。Gets the culture name in the format languagecode2-country/regioncode2.

public:
 virtual property System::String ^ Name { System::String ^ get(); };
public virtual string Name { get; }
member this.Name : string
Public Overridable ReadOnly Property Name As String

プロパティ値

英語で表した languagecode2-country/regioncode2の言語に対する ISO 639-2 の 3 桁の文字コードを取得します。The culture name in the format languagecode2-country/regioncode2. languagecode2 は、ISO 639-1 に基づく小文字の 2 文字コードです。languagecode2 is a lowercase two-letter code derived from ISO 639-1. country/regioncode2 は、ISO 3166 から派生したもので、通常は 2 文字の英語大文字で構成されます (BCP-47 の言語タグ)。country/regioncode2 is derived from ISO 3166 and usually consists of two uppercase letters, or a BCP-47 language tag.

次のコード例では、ニュートラルカルチャのいくつかのプロパティを表示します。The following code example displays several properties of the neutral cultures.

注意

この例では、zh-CHS および zh-CHT の古いカルチャ名を、カルチャ識別子としてそれぞれ 0x0004 と 0x7C04 を使用して表示します。The example displays the older zh-CHS and zh-CHT culture names with the 0x0004 and 0x7C04 culture identifiers, respectively. ただし、Windows Vista アプリケーションでは、zh-hant の代わりに zh-tw と zh-tw Zh-tw 名の代わりに zh-tw-Hans 名を使用する必要があります。However, your Windows Vista applications should use the zh-Hans name instead of zh-CHS and the zh-Hant name instead of zh-CHT. Zh-tw と zh-tw の Hans は、現在の標準を表します。古い名前を使用する理由がない限り、この名前を使用する必要があります。The zh-Hans and zh-Hant names represent the current standard, and should be used unless you have a reason for using the older names.

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

注釈

Windows システムで Name プロパティが返すことのできる定義済みカルチャ名と識別子の一覧については、 windows でサポートされる言語/地域名の一覧の「言語タグ」列を参照してください。For a list of predefined culture names and identifiers that the Name property can return on Windows systems, see the Language tag column in the list of language/region names supported by Windows. カルチャ名は、BCP 47 によって定義されている標準に準拠します。Culture names follow the standard defined by BCP 47. さらに、Windows 10 以降では、name 有効な BCP-47 言語タグを使用できます。In addition, starting with Windows 10, name can be any valid BCP-47 language tag. カルチャ名は変更される可能性があり、カスタムカルチャの名前を反映することもできます。Note that culture names are subject to change, and that they also can reflect the names of custom cultures.

CultureInfo.Name プロパティは、CultureInfo クラスのトピックに記載されている名前付け基準に従います。The CultureInfo.Name property follows the naming standards provided in the CultureInfo class topic. 代替の並べ替え順序を指定しないカルチャ名の短い形式を返します。It returns the short form of the culture name that excludes any indication of an alternate sort order. たとえば、文字列 "DE_phoneb" を使用して別の並べ替え順序を反映するように CultureInfo オブジェクトをインスタンス化する場合、Name プロパティは "de DE" を返します。For example, if you instantiate a CultureInfo object by using the string "de-DE_phoneb" to reflect an alternate sort order, the Name property returns "de-DE".

カルチャの完全な名前を取得するには、DisplayNameEnglishName、または NativeName プロパティを使用する必要があります。To get the full name of the culture, you should use the DisplayName, EnglishName, or NativeName property.

適用対象

こちらもご覧ください