RadCalendar for ASP.NET

CultureInfo and RegionInfo Send comments on this topic.
See Also
Localization and Globalization > CultureInfo and RegionInfo

Glossary Item Box

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, the country/region, the calendars in use, the format patterns for dates, currency, and numbers, and the sort order for strings. They are useful classes for writing globalized (internationalized) applications.

Two of the most important classes in this namespace 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 "<languagecode2>-<country/regioncode2>", where <languagecode2> is a lowercase two-letter code derived from ISO 639-1 and <country/regioncode2> 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

Setting the CultureInfo will work only for Month/Day names. For setting the button and label text, you need to use RadCalendar.FastNavigationSettings composite property. It has entries for localizing the OK, Cancel, and Today buttons and the "Out Of Range" error message.


 

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.

 

Example

The extract of the source code shown below illustrates how you can set the property CultureInfo at specify the revelant culture.

Setting the CultureInfo declaratively.

ASPX Copy Code
<rad:RadCalendar
  
id="RadCalendar1"
  
Runat="server"
  
CultureInfo= "English (United Kingdom)">
</
rad:RadCalendar></form>
Setting the CultureInfo programmatically in the codebehind.  
C# Copy Code
private void Page_Load(object sender, System.EventArgs e)
{
 CultureInfo CInfo =
new CultureInfo("es-ES", true );
 RadCalendar1.CultureInfo = CInfo;
}

See Also