2

DateTime を使用すると、現在のカルチャに応じてフォーマットできます。デフォルトでサポートされているカルチャは何ですか?

私が念頭に置いているシナリオではthis.Date.Value.ToString("MMMM")、カルチャが英語に設定されている場合は「January」を出力しますが、カルチャがフランス語に設定されている場合は「Janvier」を出力します。このフォーマット ドキュメントはMSDN Web サイトにありますが、これが翻訳できるカルチャの範囲を示していません。

サポートされている言語を知りたいのですが、サポートされていない言語がある場合、どのような選択肢がありますか?

4

5 に答える 5

4
Afrikaans( afr-af )
Afrikaans (South Africa)( afr-af )
Albanian( sqi-sq )
Albanian (Albania)( sqi-sq )
Alsatian( gsw-gsw )
Alsatian (France)( gsw-gsw )
Amharic( amh-am )
Amharic (Ethiopia)( amh-am )
Arabic( ara-ar )
Arabic (Algeria)( ara-ar )
Arabic (Bahrain)( ara-ar )
Arabic (Egypt)( ara-ar )
Arabic (Iraq)( ara-ar )
Arabic (Jordan)( ara-ar )
Arabic (Kuwait)( ara-ar )
Arabic (Lebanon)( ara-ar )
Arabic (Libya)( ara-ar )
Arabic (Morocco)( ara-ar )
Arabic (Oman)( ara-ar )
Arabic (Qatar)( ara-ar )
Arabic (Saudi Arabia)( ara-ar )
Arabic (Syria)( ara-ar )
Arabic (Tunisia)( ara-ar )
Arabic (U.A.E.)( ara-ar )
Arabic (Yemen)( ara-ar )
Armenian( hye-hy )
Armenian (Armenia)( hye-hy )
Assamese( asm-as )
Assamese (India)( asm-as )
Azeri( aze-az )
Azeri (Cyrillic)( aze-az )
Azeri (Cyrillic, Azerbaijan)( aze-az )
Azeri (Latin)( aze-az )
Azeri (Latin, Azerbaijan)( aze-az )
Bashkir( bak-ba )
Bashkir (Russia)( bak-ba )
Basque( eus-eu )
Basque (Basque)( eus-eu )
Belarusian( bel-be )
Belarusian (Belarus)( bel-be )
Bengali( bng-bn )
Bengali (Bangladesh)( bng-bn )
Bengali (India)( bng-bn )
Bosnian( bsb-bs )
Bosnian (Cyrillic)( bsc-bs )
Bosnian (Cyrillic, Bosnia and Herzegovina)( bsc-bs )
Bosnian (Latin)( bsb-bs )
Bosnian (Latin, Bosnia and Herzegovina)( bsb-bs )
Breton( bre-br )
Breton (France)( bre-br )
Bulgarian( bul-bg )
Bulgarian (Bulgaria)( bul-bg )
Catalan( cat-ca )
Catalan (Catalan)( cat-ca )
Chinese( zho-zh )
Chinese (Simplified)( zho-zh )
Chinese (Simplified) Legacy( zho-zh )
Chinese (Simplified, PRC)( zho-zh )
Chinese (Simplified, Singapore)( zho-zh )
Chinese (Traditional)( zho-zh )
Chinese (Traditional) Legacy( zho-zh )
Chinese (Traditional, Hong Kong S.A.R.)( zho-zh )
Chinese (Traditional, Macao S.A.R.)( zho-zh )
Chinese (Traditional, Taiwan)( zho-zh )
Corsican( cos-co )
Corsican (France)( cos-co )
Croatian( hrv-hr )
Croatian (Croatia)( hrv-hr )
Croatian (Latin, Bosnia and Herzegovina)( hrb-hr )
Czech( ces-cs )
Czech (Czech Republic)( ces-cs )
Danish( dan-da )
Danish (Denmark)( dan-da )
Dari( prs-prs )
Dari (Afghanistan)( prs-prs )
Divehi( div-dv )
Divehi (Maldives)( div-dv )
Dutch( nld-nl )
Dutch (Belgium)( nld-nl )
Dutch (Netherlands)( nld-nl )
English( eng-en )
English (Australia)( eng-en )
English (Belize)( eng-en )
English (Canada)( eng-en )
English (Caribbean)( eng-en )
English (India)( eng-en )
English (Ireland)( eng-en )
English (Jamaica)( eng-en )
English (Malaysia)( eng-en )
English (New Zealand)( eng-en )
English (Republic of the Philippines)( eng-en )
English (Singapore)( eng-en )
English (South Africa)( eng-en )
English (Trinidad and Tobago)( eng-en )
English (United Kingdom)( eng-en )
English (United States)( eng-en )
English (Zimbabwe)( eng-en )
Estonian( est-et )
Estonian (Estonia)( est-et )
Faroese( fao-fo )
Faroese (Faroe Islands)( fao-fo )
Filipino( fil-fil )
Filipino (Philippines)( fil-fil )
Finnish( fin-fi )
Finnish (Finland)( fin-fi )
French( fra-fr )
French (Belgium)( fra-fr )
French (Canada)( fra-fr )
French (France)( fra-fr )
French (Luxembourg)( fra-fr )
French (Monaco)( fra-fr )
French (Switzerland)( fra-fr )
Frisian( fry-fy )
Frisian (Netherlands)( fry-fy )
Galician( glg-gl )
Galician (Galician)( glg-gl )
Georgian( kat-ka )
Georgian (Georgia)( kat-ka )
German( deu-de )
German (Austria)( deu-de )
German (Germany)( deu-de )
German (Liechtenstein)( deu-de )
German (Luxembourg)( deu-de )
German (Switzerland)( deu-de )
Greek( ell-el )
Greek (Greece)( ell-el )
Greenlandic( kal-kl )
Greenlandic (Greenland)( kal-kl )
Gujarati( guj-gu )
Gujarati (India)( guj-gu )
Hausa( hau-ha )
Hausa (Latin)( hau-ha )
Hausa (Latin, Nigeria)( hau-ha )
Hebrew( heb-he )
Hebrew (Israel)( heb-he )
Hindi( hin-hi )
Hindi (India)( hin-hi )
Hungarian( hun-hu )
Hungarian (Hungary)( hun-hu )
Icelandic( isl-is )
Icelandic (Iceland)( isl-is )
Igbo( ibo-ig )
Igbo (Nigeria)( ibo-ig )
Indonesian( ind-id )
Indonesian (Indonesia)( ind-id )
Inuktitut( iku-iu )
Inuktitut (Latin)( iku-iu )
Inuktitut (Latin, Canada)( iku-iu )
Inuktitut (Syllabics)( iku-iu )
Inuktitut (Syllabics, Canada)( iku-iu )
Invariant Language (Invariant Country)( ivl-iv )
Irish( gle-ga )
Irish (Ireland)( gle-ga )
isiXhosa( xho-xh )
isiXhosa (South Africa)( xho-xh )
isiZulu( zul-zu )
isiZulu (South Africa)( zul-zu )
Italian( ita-it )
Italian (Italy)( ita-it )
Italian (Switzerland)( ita-it )
Japanese( jpn-ja )
Japanese (Japan)( jpn-ja )
Kannada( kan-kn )
Kannada (India)( kan-kn )
Kazakh( kaz-kk )
Kazakh (Kazakhstan)( kaz-kk )
Khmer( khm-km )
Khmer (Cambodia)( khm-km )
K'iche( qut-qut )
K'iche (Guatemala)( qut-qut )
Kinyarwanda( kin-rw )
Kinyarwanda (Rwanda)( kin-rw )
Kiswahili( swa-sw )
Kiswahili (Kenya)( swa-sw )
Konkani( kok-kok )
Konkani (India)( kok-kok )
Korean( kor-ko )
Korean (Korea)( kor-ko )
Kyrgyz( kir-ky )
Kyrgyz (Kyrgyzstan)( kir-ky )
Lao( lao-lo )
Lao (Lao P.D.R.)( lao-lo )
Latvian( lav-lv )
Latvian (Latvia)( lav-lv )
Lithuanian( lit-lt )
Lithuanian (Lithuania)( lit-lt )
Lower Sorbian( dsb-dsb )
Lower Sorbian (Germany)( dsb-dsb )
Luxembourgish( ltz-lb )
Luxembourgish (Luxembourg)( ltz-lb )
Macedonian (Former Yugoslav Republic of Macedonia)( mkd-mk )
Macedonian (FYROM)( mkd-mk )
Malay( msa-ms )
Malay (Brunei Darussalam)( msa-ms )
Malay (Malaysia)( msa-ms )
Malayalam( mym-ml )
Malayalam (India)( mym-ml )
Maltese( mlt-mt )
Maltese (Malta)( mlt-mt )
Maori( mri-mi )
Maori (New Zealand)( mri-mi )
Mapudungun( arn-arn )
Mapudungun (Chile)( arn-arn )
Marathi( mar-mr )
Marathi (India)( mar-mr )
Mohawk( moh-moh )
Mohawk (Mohawk)( moh-moh )
Mongolian( mon-mn )
Mongolian (Cyrillic)( mon-mn )
Mongolian (Cyrillic, Mongolia)( mon-mn )
Mongolian (Traditional Mongolian)( mon-mn )
Mongolian (Traditional Mongolian, PRC)( mon-mn )
Nepali( nep-ne )
Nepali (Nepal)( nep-ne )
Norwegian( nob-nb )
Norwegian (Bokmål)( nob-nb )
Norwegian (Nynorsk)( nno-nn )
Norwegian, Bokmål (Norway)( nob-nb )
Norwegian, Nynorsk (Norway)( nno-nn )
Occitan( oci-oc )
Occitan (France)( oci-oc )
Oriya( ori-or )
Oriya (India)( ori-or )
Pashto( pus-ps )
Pashto (Afghanistan)( pus-ps )
Persian( fas-fa )
Persian( fas-fa )
Polish( pol-pl )
Polish (Poland)( pol-pl )
Portuguese( por-pt )
Portuguese (Brazil)( por-pt )
Portuguese (Portugal)( por-pt )
Punjabi( pan-pa )
Punjabi (India)( pan-pa )
Quechua( qub-quz )
Quechua (Bolivia)( qub-quz )
Quechua (Ecuador)( que-quz )
Quechua (Peru)( qup-quz )
Romanian( ron-ro )
Romanian (Romania)( ron-ro )
Romansh( roh-rm )
Romansh (Switzerland)( roh-rm )
Russian( rus-ru )
Russian (Russia)( rus-ru )
Sami (Inari)( smn-smn )
Sami (Lule)( smk-smj )
Sami (Northern)( sme-se )
Sami (Skolt)( sms-sms )
Sami (Southern)( smb-sma )
Sami, Inari (Finland)( smn-smn )
Sami, Lule (Norway)( smj-smj )
Sami, Lule (Sweden)( smk-smj )
Sami, Northern (Finland)( smg-se )
Sami, Northern (Norway)( sme-se )
Sami, Northern (Sweden)( smf-se )
Sami, Skolt (Finland)( sms-sms )
Sami, Southern (Norway)( sma-sma )
Sami, Southern (Sweden)( smb-sma )
Sanskrit( san-sa )
Sanskrit (India)( san-sa )
Scottish Gaelic( gla-gd )
Scottish Gaelic (United Kingdom)( gla-gd )
Serbian( srp-sr )
Serbian (Cyrillic)( srp-sr )
Serbian (Cyrillic, Bosnia and Herzegovina)( srn-sr )
Serbian (Cyrillic, Montenegro)( srp-sr )
Serbian (Cyrillic, Serbia and Montenegro (Former))( srp-sr )
Serbian (Cyrillic, Serbia)( srp-sr )
Serbian (Latin)( srp-sr )
Serbian (Latin, Bosnia and Herzegovina)( srs-sr )
Serbian (Latin, Montenegro)( srp-sr )
Serbian (Latin, Serbia and Montenegro (Former))( srp-sr )
Serbian (Latin, Serbia)( srp-sr )
Sesotho sa Leboa( nso-nso )
Sesotho sa Leboa (South Africa)( nso-nso )
Setswana( tsn-tn )
Setswana (South Africa)( tsn-tn )
Sinhala( sin-si )
Sinhala (Sri Lanka)( sin-si )
Slovak( slk-sk )
Slovak (Slovakia)( slk-sk )
Slovenian( slv-sl )
Slovenian (Slovenia)( slv-sl )
Spanish( spa-es )
Spanish (Argentina)( spa-es )
Spanish (Bolivarian Republic of Venezuela)( spa-es )
Spanish (Bolivia)( spa-es )
Spanish (Chile)( spa-es )
Spanish (Colombia)( spa-es )
Spanish (Costa Rica)( spa-es )
Spanish (Dominican Republic)( spa-es )
Spanish (Ecuador)( spa-es )
Spanish (El Salvador)( spa-es )
Spanish (Guatemala)( spa-es )
Spanish (Honduras)( spa-es )
Spanish (Mexico)( spa-es )
Spanish (Nicaragua)( spa-es )
Spanish (Panama)( spa-es )
Spanish (Paraguay)( spa-es )
Spanish (Peru)( spa-es )
Spanish (Puerto Rico)( spa-es )
Spanish (Spain)( spa-es )
Spanish (United States)( spa-es )
Spanish (Uruguay)( spa-es )
Swedish( swe-sv )
Swedish (Finland)( swe-sv )
Swedish (Sweden)( swe-sv )
Syriac( syr-syr )
Syriac (Syria)( syr-syr )
Tajik( tgk-tg )
Tajik (Cyrillic)( tgk-tg )
Tajik (Cyrillic, Tajikistan)( tgk-tg )
Tamazight( tzm-tzm )
Tamazight (Latin)( tzm-tzm )
Tamazight (Latin, Algeria)( tzm-tzm )
Tamil( tam-ta )
Tamil (India)( tam-ta )
Tatar( tat-tt )
Tatar (Russia)( tat-tt )
Telugu( tel-te )
Telugu (India)( tel-te )
Thai( tha-th )
Thai (Thailand)( tha-th )
Tibetan( bod-bo )
Tibetan (PRC)( bod-bo )
Turkish( tur-tr )
Turkish (Turkey)( tur-tr )
Turkmen( tuk-tk )
Turkmen (Turkmenistan)( tuk-tk )
Ukrainian( ukr-uk )
Ukrainian (Ukraine)( ukr-uk )
Upper Sorbian( hsb-hsb )
Upper Sorbian (Germany)( hsb-hsb )
Urdu( urd-ur )
Urdu (Islamic Republic of Pakistan)( urd-ur )
Uyghur( uig-ug )
Uyghur (PRC)( uig-ug )
Uzbek( uzb-uz )
Uzbek (Cyrillic)( uzb-uz )
Uzbek (Cyrillic, Uzbekistan)( uzb-uz )
Uzbek (Latin)( uzb-uz )
Uzbek (Latin, Uzbekistan)( uzb-uz )
Vietnamese( vie-vi )
Vietnamese (Vietnam)( vie-vi )
Welsh( cym-cy )
Welsh (United Kingdom)( cym-cy )
Wolof( wol-wo )
Wolof (Senegal)( wol-wo )
Yakut( sah-sah )
Yakut (Russia)( sah-sah )
Yi( iii-ii )
Yi (PRC)( iii-ii )
Yoruba( yor-yo )
Yoruba (Nigeria)( yor-yo )
于 2012-07-25T13:17:39.460 に答える
2

CultureInfo.GetCulturesサポートされているすべてのカルチャを取得するために使用できます。

CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures & ~CultureTypes.NeutralCultures);
string allTranslatedJanuaries = 
    string.Join(Environment.NewLine, cultures.Select(c =>
        String.Format("{0}: {1}", c.EnglishName, c.DateTimeFormat.GetMonthName(1))));

デモはこちら: http://ideone.com/9CUjK

私のサーバーには 352 個の文化がインストールされており、ideone では 112 個しかインストールされていません。

于 2012-07-25T13:16:08.677 に答える
1

サポートされているカルチャのセットは、ボックスにインストールされているカスタムカルチャのセットと事前定義されたカルチャのセットです(.Net 3.5以下またはVista以下の場合は固定セットですが、.Net4以降の場合はWin7以降では、これは実行されているOSの事前定義されたカルチャです)。

言語がサポートされていない場合は、カスタムカルチャを作成できます。これをインストールするには、管理者権限が必要です。

于 2012-07-25T16:25:06.427 に答える
1

OSがサポートするすべての言語を想像します(情報がどこから来るかを考えると)。

OS ごとにデフォルトでサポートされているすべての言語のリストを次に示します。

于 2012-07-25T13:08:18.800 に答える
0

次のように文化を変えることができます。

CurrentThread.CurrentCulture を新しいカルチャに設定します。たとえば、フランス語に設定します。

System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("fr-FR");
System.Threading.Thread.CurrentThread.CurrentCulture = ci;

日付形式の後、月名はフランス語になります。

これらの文化から選択できます

于 2012-07-25T13:13:28.840 に答える