Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
TwoLetterISOLanguageName Property

CultureInfo.TwoLetterISOLanguageName Property

Gets the ISO 639-1 two-letter code for the language of the current CultureInfo.

Namespace:  System.Globalization
Assemblies:   mscorlib (in mscorlib.dll)
  System.Globalization (in System.Globalization.dll)

public virtual string TwoLetterISOLanguageName { get; }

Property Value

Type: System.String
The ISO 639-1 two-letter code for the language of the current CultureInfo.

For example, the two-letter abbreviation for English is "en". The TwoLetterISOLanguageName property value for the invariant culture is "iv".


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.

If ISO 639-1 does not define a two-letter language code for a particular culture, the TwoLetterISOLanguageName property returns a string that consists of three or more letters. For more information, see the example.

The following example lists the cultures whose TwoLetterISOLanguageName property does not consist of a two-letter language code.

using System;
using System.Globalization;

public class Example
   public static void Main()
      // Get all available cultures on the current system.
      CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);

      Console.WriteLine("{0,-32} {1,-13} {2,-6}\n", "Display Name", 
                        "Name", "TwoLetterISOLanguageName");

      foreach (var culture in cultures) {
         // Exclude custom cultures. 
         if ((culture.CultureTypes & CultureTypes.UserCustomCulture) == CultureTypes.UserCustomCulture) 

         // Exclude all two-letter codes. 
         if (culture.TwoLetterISOLanguageName.Length == 2)

         Console.WriteLine("{0,-32} {1,-13} {2,-6}", culture.DisplayName,
                           culture.Name, culture.TwoLetterISOLanguageName);
// The example output like the following: 
//       Display Name                     Name          TwoLetterISOLanguageName 
//       Upper Sorbian                    hsb           hsb 
//       Konkani                          kok           kok 
//       Syriac                           syr           syr 
//       Tamazight                        tzm           tzm 
//       Filipino                         fil           fil 
//       Quechua                          quz           quz 
//       Sesotho sa Leboa                 nso           nso 
//       Mapudungun                       arn           arn 
//       Mohawk                           moh           moh 
//       Alsatian                         gsw           gsw 
//       Sakha                            sah           sah 
//       K'iche                           qut           qut 
//       Dari                             prs           prs 
//       Upper Sorbian (Germany)          hsb-DE        hsb 
//       Konkani (India)                  kok-IN        kok 
//       Syriac (Syria)                   syr-SY        syr 
//       Filipino (Philippines)           fil-PH        fil 
//       Quechua (Bolivia)                quz-BO        quz 
//       Sesotho sa Leboa (South Africa)  nso-ZA        nso 
//       Mapudungun (Chile)               arn-CL        arn 
//       Mohawk (Mohawk)                  moh-CA        moh 
//       Alsatian (France)                gsw-FR        gsw 
//       Sakha (Russia)                   sah-RU        sah 
//       K'iche (Guatemala)               qut-GT        qut 
//       Dari (Afghanistan)               prs-AF        prs 
//       Lower Sorbian (Germany)          dsb-DE        dsb 
//       Tamazight (Latin, Algeria)       tzm-Latn-DZ   tzm 
//       Quechua (Ecuador)                quz-EC        quz 
//       Quechua (Peru)                   quz-PE        quz 
//       Sami, Lule (Norway)              smj-NO        smj 
//       Sami, Lule (Sweden)              smj-SE        smj 
//       Sami, Southern (Norway)          sma-NO        sma 
//       Sami, Southern (Sweden)          sma-SE        sma 
//       Sami, Skolt (Finland)            sms-FI        sms 
//       Sami, Inari (Finland)            smn-FI        smn 
//       Sami (Inari)                     smn           smn 
//       Sami (Skolt)                     sms           sms 
//       Sami (Southern)                  sma           sma 
//       Lower Sorbian                    dsb           dsb 
//       Sami (Lule)                      smj           smj 
//       Tamazight (Latin)                tzm-Latn      tzm

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library
© 2015 Microsoft