Custom ResourceReader - TechEd Sample
Where to store localization information?

nuqneHdir and Qapla' - TechEd Samples

I've added a fun sample to my TechEd presentation Building International Applications with the .NET Framework: localization to Klingon.

To make this possible I've created a class EnterpriseCultureInfo that derives from CultureInfo. This way a EnterpriseCultureInfo object can be passed everywhere a CultureInfo is needed; e.g. setting the culture to the thread (CurrentUICulture property), or passing it as an argument of ToString() methods.

But there is one disadvantage of extending CultureInfo: CultureInfo requires passing a ISO-defined culture in the constructor. Because Klingon is not already defined with the .NET Framework, I've done a hack and set the culture of the base class to a valid value. I would prefer interfaces - the hack wouldn't be necessary if an interface ICultureInfo would be defined that is used instead of the CultureInfo class.

What makes the EnterpriseCulture different is allowing to set a extended culture. In my implementation, et-klingon and et-vulcano is allowed. In addition to that properties such as Name, DisplayName, EnglishName are overridden. Calendar information, time and number formatting could be defined, too.

In addition to the EnterpriseCulture class, a resource reader that supports Klingon is needed. My DBResourceReader class that I already mentioned in my previous post supports any language that is defined in the database.

In the database I've just added two Klingon words for the sample: "nuqneHdir" is Klingon's greeting. It is not really a "welcome", as such a meaning is not used with Klingon words. Instead this is the translation of "what do you want?" - Klingon's greeting. Goodbye is "Qapla'" in Klingon.

More words can be found in the online dictionary.

Have fun!



Feed You can follow this conversation by subscribing to the comment feed for this post.

Alex Lowe's .NET Blog

AUTHOR: Alex Lowe's .NET Blog
DATE: 08/31/2003 06:07:00 PM

Jason Salas' WebLog

AUTHOR: Jason Salas' WebLog
DATE: 02/02/2004 01:39:00 AM

Christian Nagel's OneNotes

AUTHOR: Christian Nagel's OneNotes
DATE: 04/21/2004 08:00:00 AM

Christian Nagel's OneNotes

AUTHOR: Christian Nagel's OneNotes
DATE: 01/14/2005 02:54:00 AM

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 posted. 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

Your Information

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