Export (0) Print
Expand All

CultureInfo.GetConsoleFallbackUICulture Method

Note: This method is new in the .NET Framework version 2.0.

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

Return Value

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

Languages such as Arabic, Hebrew, Farsi, Urdu, and Syriac are based on bidirectional text. Windows applications, which employ 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. Consequently, if a developer localizes a console application to Arabic or Hebrew, the application will display 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 you have retrieved the fallback UI culture, assign it to the current UI 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 a few cultures and their corresponding fallback user interface culture.

Culture name

English culture name

Fallback UI culture

ar-DZ

Algeria

fr

ar-BH

Bahrain

en

ar-IQ

Iraq

en

ar-JO

Jordan

en

ar-KW

Kuwait

en

ar-LB

Lebanon

en

ar-LY

Libya

en

ar-MA

Morocco

fr

ar-OM

Oman

en

ar-QA

Qatar

en

ar-SA

Saudi Arabia

en

ar-SY

Syria

en

ar-TN

Tunisia

fr

ar-AE

United Arab Emirates

en

ar-YE

Yemen

en

ar

(neutral Arabic)

en

he-IL

(Hebrew/Israel)

en

he

(neutral Hebrew)

en

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 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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2015 Microsoft