New to Telerik UI for WinForms? Download free 30-day trial

CultureInfo and RegionInfo Basics

Telerik RadCalendar provides full support for the System.Globalization Namespace. This namespace consists of classes (CompareInfo, CultureInfo, RegionInfo, etc.) which contain culture-related information, such as the language, country/region, calendars in use, format patterns for dates, currency, and numbers, and the sort order for strings. They are useful classes for writing internationalized applications.

Two of the most important classes in this namespaces are: CultureInfo and RegionInfo

CultureInfo

Represents information about a specific culture including the names of the culture, the writing system, and the calendar used, as well as access to culture-specific objects that provide information for common operations, such as formatting dates and sorting strings.

The culture names follow the RFC 1766 standard in the format "-", where is a lowercase two-letter code derived from ISO 639-1 and is an uppercase two-letter code derived from ISO 3166. For example, U.S. English is "en-US".

The complete list of the predefined CultureInfo names and identifiers can be found in CultureInfo class and  the classes in the System.Globalization namespace.

The table below is a sample list of the names and identifiers found in the CultureInfo class.

Culture Name Culture Identifier Language-Country/Region
bg-BG 0x0402 Bulgarian - Bulgaria
en-GB 0x0809 English - United Kingdom
fr-FR 0x040C French - France
es-ES 0x0C0A Spanish - Spain
ar-SA 0x0401 Arabic - Saudi Arabia
fa-IR 0x0429 Farsi - Iran
ps-AF 0x0463 Pashto - Afghanistan

Figure 1: Setting Pashto Culture

WinForms RadCalendar Setting Pashto Culture

this.radCalendar1.Culture = new System.Globalization.CultureInfo("ps-AF");

Me.RadCalendar1.Culture = New System.Globalization.CultureInfo("ps-AF")

There is a known issue in the .NET Framework considering the "fa-IR" culture. Please refer to the following MSDN resource for a solution: Fixing Persian Locale for Persian Calendar and Month Names

RegionInfo

The RegionInfo class contains information about the country/region.  In contrast to CultureInfo, RegionInfo does not represent preferences of the user and does not depend on the user's language or culture. The RegionInfo name is one of the two-letter codes defined in ISO 3166 for country/region. Case is not significant; however, the Name, the TwoLetterISORegionName, and the ThreeLetterISORegionName properties return the appropriate code in uppercase.

See Also

In this article