|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
IntroductionGlobalization means the process of preparing your code to be able to support different languages. This is done by eliminating language or culture dependencies from your code to become culture-neutral. That is to avoid using hard coded strings or messages to be displayed to the user. .NET has a bunch of classes integrated to support the development of international software. These classes are located in the namespaces DetailsThe Culture names follow the RFC 1766 standard in the format <languagecode>-<country/regioncode> where <languagecode> is a lowercase two-letter code derived form ISO639-1 and <country/regioncode> is an uppercase two-letter code derived from ISO 3166. The cultures are generally grouped into three sets:
A Format Specifier Format Pattern
d MM/dd/yyyy
D dddd*, MMMM* dd, yyyy
f dddd*, MMMM* dd, yyyy HH*:mm*
F dddd*, MMMM* dd, yyyy HH*:mm*:ss*
g MM/dd/yyyy HH*:mm*
G MM/dd/yyyy HH*:mm*:ss*
m, M MMMM* dd
t HH*:mm*
T HH*:mm*:ss*
U dddd*, MMMM* dd, yyyy HH*:mm*:ss*
y, Y YYYY MMMM*
About Source CodeIn the enclosed source code, add the the using System.Globalization;
Now, collect all the culture with the following code of line: CultureInfo [] ci = CultureInfo.GetCultures(CultureTypes.SpecificCultures);
cbCultures.Items.Add(new cultureinfo(ci[i].Name));
For example: patterns = dtf.GetAllDateTimePatterns('D');
for (int i = 0;i < patterns.GetLength(0);i++)
{
updLongDatePattern.Items.Add(patterns[i]);
}
where private void updLongDatePattern_SelectedItemChanged(object sender,
System.EventArgs e)
{
try
{
textLongDate.Text = dt.ToString(updLongDatePattern.Text,
curci.DateTimeFormat);
}
catch {}
}
Use the
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||