In love with Enso: C# Plugin framework for Enso with sample text replace plugin
Fun with Generics: Using constraints to limit Generics applicability using the 'where' keyword

Internationalization: Creating a custom culture

.NET Runtime ships with several languages and support for creating a custom language. But the Operating System or the .NET did not have built in support for my native language "Bangla". In order to implement Bangla in my program I had to create a custom culture and write the resource files for that custom language. Once a language has been created and registered it does not need to be created again. So in a windows PC the registration code should run only once. See the code below which shows how to achieve this by using CultureAndRegionInfoBuilder class.

CultureAndRegionInfoBuilder builder =new CultureAndRegionInfoBuilder("bn",

// there is no neutral Bengali culture to set the parent
builder.Parent = CultureInfo.InvariantCulture;
builder.CultureEnglishName = "Bengali (Bangladesh)";
builder.CultureNativeName = "বাংলা";
builder.ThreeLetterISOLanguageName = "ben";
builder.ThreeLetterWindowsLanguageName = "ben";
builder.TwoLetterISOLanguageName = "bn";
builder.IetfLanguageTag = "bn-BD";
builder.KeyboardLayoutId = 1081;
builder.TextInfo = CultureInfo.InvariantCulture.TextInfo;
builder.CompareInfo = CultureInfo.InvariantCulture.CompareInfo;

// Register the culture

How do use this custom culture in our code? Here is how ...

Thread.CurrentThread.CurrentCulture = 
Thread.CurrentThread.CurrentUICulture = new CultureInfo("bn");
This should be done before loading the UI. I am assuming that the reader know all about custom resource files and how to use them

kick it on


Moim Hossain

WOW! Interesting. I like it. thanks for the post.

Shafqat Ahmed

Thanks for the comment. I just showed a minimum barebone code implementation. You can find details with C# implmentation of Bangla in the following Codeproject article which is actually a chapter from a book ".NET Internationalization: The Developer's Guide to Building Global Windows and Web Applications: Chapter 11 - Custom Cultures"

The article is located here

Kaushik Ghosh

Your post was usefull. Do you have any idea of creating custom HTTP Handler for handling a webservice request and producing response or accepting request in JSON format. Please tell me if you know

Shafqat Ahmed

Yes I do, Please email me your specific question


Hi Thanks for your help.

but when i tried to run this code, it was throwing errors like CultureAndRegionInfoBuilder is not avilable/no reference found. whcih name space do i need to give reference

Gents Glasses Case


Add a reference to sysglobl.dll located under the framework v2... dir.

The comments to this entry are closed.