Export (0) Print
Expand All

CultureInfo.GetConsoleFallbackUICulture Method

Gets an alternate user interface culture suitable for console applications when the default graphic user interface culture is unsuitable.

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

[ComVisibleAttribute(false)] 
public CultureInfo GetConsoleFallbackUICulture ()
/** @attribute ComVisibleAttribute(false) */ 
public CultureInfo GetConsoleFallbackUICulture ()
ComVisibleAttribute(false) 
public function GetConsoleFallbackUICulture () : CultureInfo
Not applicable.

Return Value

An alternate neutral culture that is used to read and display text on the console.

Languages such as Arabic, Hebrew, Urdu, and Syriac are based on bidirectional text. Windows applications, which have a graphical user interface, support bidirectional languages. However, console applications, which employ the text user interface of the operating system console, do not provide bidirectional support. Therefore, if you localize a console application to Arabic or Hebrew, your application displays unreadable text on the console screen.

The user interface culture specifies the resources an application needs to support user input and output, and by default is the same as the operating system culture. For example, the CultureInfo.CurrentUICulture property returns an Arabic culture for an Arabic operating system. Use the GetConsoleFallbackUICulture method to retrieve a neutral culture suitable for a console application user interface. After your application retrieves the fallback user interface culture, it should assign the culture to the current user interface culture of the current thread. For more information, see the "Explicitly Setting the CurrentUICulture Property" subtopic of the Using the CurrentUICulture Property topic.

The following table lists predefined cultures having a fallback user interface culture that differs from the culture itself. The list is complete as of the initial release of .NET Framework 2.0.

Culture/Language Name

English Culture

Fallback UI Culture

ar

(neutral Arabic)

en

ar-DZ

Arabic (Algeria)

fr

ar-BH

Arabic (Bahrain)

en

ar-EG

Arabic (Egypt)

en

ar-IQ

Arabic (Iraq)

en

ar-JO

Arabic (Jordan)

en

ar-KW

Arabic (Kuwait)

en

ar-LB

Arabic (Lebanon)

en

ar-LY

Arabic (Libya)

en

ar-MA

Arabic (Morocco)

fr

ar-OM

Arabic (Oman)

en

ar-QA

Arabic (Qatar)

en

ar-SA

Arabic (Saudi Arabia)

en

ar-SY

Arabic (Syria)

en

ar-TN

Arabic (Tunisia)

fr

ar-AE

Arabic (U.A.E.)

en

ar-YE

Arabic (Yemen)

en

dv

Divehi

en

dv-MV

Divehi (India)

en

fa

Persian

en

fa-IR

Persian (Iran)

en

gu

Gujarati

en

gu-IN

Gujarati (India)

en

he

Hebrew

en

he-IL

Hebrew (Israel)

en

hi

Hindi

en

hi-IN

Hindi (India)

en

kn

Kannada

en

kn-IN

Kannada (India)

en

kok

Konkani

en

kok -IN

Konkani (India)

en

mr

Marathi

en

mr -IN

Marathi (India)

en

pa

Punjabi

en

pa -IN

Punjabi (India)

en

sa

Sanskrit

en

sa -IN

Sanskrit (India)

en

syr

Syriac

en

syr-SY

Syriac (Syria)

en

ta

Tamil

en

ta -IN

Tamil (India)

en

te

Telugu

en

te -IN

Telugu (India)

en

th

Thai

en

th-Th

Thai (Thailand)

en

ur

Urdu

en

ur-PK

Urdu (Pakistan)

en

vi

Vietnamese

en

vi-VN

Vietnamese (Vietnam)

en

For cultures that have WindowsOnlyCultures set in CultureTypes, the console fallback culture is always the invariant culture, InvariantCulture, and this cannot be changed. However, your application can use CultureAndRegionInfoBuilder to create a replacement for this culture, and that culture can have a console fallback culture of your choosing.

The following code example displays the fallback user interface culture associated with a culture object.

// This example demonstrates the GetConsoleFallbackUICulture() method
using System;
using System.Globalization;

class Sample 
{
    public static void Main() 
    {
    CultureInfo ci = new CultureInfo("ar-DZ");
    Console.WriteLine("Culture name: . . . . . . . . . {0}", ci.Name);
    Console.WriteLine("Console fallback UI culture:. . {0}",
                       ci.GetConsoleFallbackUICulture().Name);
    }
}
/*
This code example produces the following results:

Culture name: . . . . . . . . . ar-DZ
Console fallback UI culture:. . fr

*/

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft