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.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment

Comments are moderated, and will not appear until the author has approved them.

Your Information

(Name and email address are required. Email address will not be displayed with the comment.)