In general we develop our application in US culture (English Language) but what
if we want to sell our software where English language is not used.
Globalization is the process of designing and developing applications that
supports for multiple cultures. So a program or an application can be usable
across multiple cultures and regions, no matter which language or culture is
there. All the types are available in System. Globalization namespace
CultureInfo Class
This class enables you to get the culture information of a .NET application. You
can retrieve and manipulate the culture information by using this class. This
class mainly provides the information such as:
Format of numbers and dates
Casing conventions
Culture’s writing system
Culture’s calendar
Culture’s language
Culture can be divided in three Categories:
Invariant Culture
Neutral Culture
Specific Culture
Invariant Culture
This culture category is culture-insensitive. You can use this culture when you
using dates or strings regardless of the culture’s format. It will greatly
simplify the task of comparing these dates or Strings.
Neutral Culture
A neutral culture is represented with a language but has no relationship to
countries or regions.
The neutral culture will be designated by the first two characters As example:
English (en) Neutral Culture
French (fr)
Spanish (sp)
Specific Culture
It represented by a neutral culture, a hyphen, and then a specific culture
abbreviation. For example, in the following designations “fr-FR” , “en-US”, and
“zh-CN” fr , en and zh represent the neutral culture (French , English and
Chinese, respectively), and FR , US and CN represent the specific culture
(France , United States and China, respectively).
Example:
This example gives the culture information of current application.
using System;
using System.Threading;
using System.Globalization;
Display Name : English(United States)
English Name: English(United States)
IsNeutralCulture: False
Name: en-US
NativeName : English(United States)
TwoLetterISOLanguageName: en
DateTimeFormatInfo and NumberFormatInfo Classes
The DateTimeFormatInfo and NumberFormatInfo class provides important set of
methods and properties to handle and respond to the dates of different cultures
Example:
The following example gives the name of days in French.
CultureInfo
demo = new CultureInfo("fr-FR");
String[]
Days = demo.DateTimeFormat.DayNames;
foreach
(String Day in Days)
{
Label1.Text += Day+"<br>";
}
}
Example:
The following example gives the currency symbol in French.
RegionInfo class provides specific information about a particular country or
region.RegionInfo class constructor uses the numeric identifiers (such as
LCID). We can get the region name and currency symbol of the user’s region by
writing the following code.