It's been easy to get French and Spanish translations added to our site, but we want to add Haitian Creole now and there is no Culture support for it. What's the best way to get this done?
+2
A:
You can create the culture through .Net using the CultureAndRegionInfoBuilder class. As this code needs to run with administrative privileges, it's generally advised that you do it as a separate program or script that runs as part of the installation stage of the software. Once it's set up, you can use it like any other Culture.
This example is based on the example in the MS .Net Application Development Foundation book (2nd ed. p697):
var builder = new CultureAndRegionInfoBuilder("en-PL", CultureAndRegionModifiers.None);
builder.LoadDataFromCultureInfo(new CultureInfo("en-US"));
builder.LoadDataFromRegionInfo(new RegionInfo("US"));
builder.CultureEnglishName = "Pig Latin";
builder.CultureNativeName = "Igpay Atinlay";
builder.IsMetric = true;
builder.ISOCurrencySymbol = "PLD";
builder.RegionEnglishName = "Pig Latin Region";
builder.RegionNativeName = "Igpay Atinlay Egionray";
builder.Register();
Once that's done, you can retrieve your culture in the program.
var culture = new CultureInfo("en-PL");
Matt
2010-08-04 13:06:59