internationalization

Selected posts on CLR, threading, Internationalization and WPF

I have been professionally working in the software industry for over 9 years but I am relatively new to the blogging community. I have only started to blog around 5 months ago. I have selected some of my previous posts which I liked. Please find the links below

CLR Fun Stuff: How is my C# code converted into machine instructions?
This post decribes the process of MSIL being converted to binary instruction bt the JIT compiler.

WeakReference: GC knows the Best
A basic look at the Weak Reference class which helps to re-aquire data left for garbage collection.

Multi-core CPU Caching: What is volatile?
What is the impact of the volatile keyword in the world of multi-cored CPUs

Dll heaven: Executing multiple versions of the same assembly
How can you execute code from different versions of an assembly in a single process.

Spider's Web: Spawning threads in .NET, The Basics
A basic look at threading. It was going to be 1st part of a 5 part series, but it was discontinued as there was a good free e-book available on .NET threading.

Basic WPF: Stylize standard tabs into Aqua Gel
How can you change the look of the standard controls with styles in WPF

Fun with Generics: Using constraints to limit Generics applicability using the 'where' keyword
A less used but powerful architecture tool, type limiting in generics

Internationalization: Creating a custom culture
How can you add support for your language/culture if .NET does not have built in support for the language like my language ' Bangla'

kick it on DotNetKicks.com

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",
              CultureAndRegionModifiers.Neutral);

// 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
builder.Register();

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

Thread.CurrentThread.CurrentCulture = 
         CultureInfo.CreateSpecificCulture("bn");
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 DotNetKicks.com