DotNetNuke

DotNetNuke localization

February 12, 2005

author:

DotNetNuke localization

As I prepare new releases of my modules for DNN 2.x, I am trying to add as many features as possible that will make the transition to DNN 3.x easy. One of these is localization. DNN 3.x uses non-compiled .resx files to store localized resource strings. The files are stored in sub-directories of the control to which they apply.

This is all quite good because it allows different modules to be installed with their supporting resx files. However, after careful consideration, I decided I am not going to follow this route for any Speerio products. There are two reasons for this:

1) The resx format is too verbose for my needs and does not offer any significant advantage to a standard XML file other than the ability to store binary resources.

2) The location of files is difficult to manage. I think grouping of files by locale is more logical than grouping based on the control the file belongs to.

So, I have created the Speerio.Web.Globalization class which I can use interchangably in DNN 2.x and DNN 3.x. The file format is very simple:


 
 

The file is named {AppName}.locale.xml  (example: FileManager.en-US.xml)

All files go into ~/Controls/Speerio/Globalization/{locale}

Example: ~/Controls/Speerio/Globalization/en-US/FileManager.en-US.xml

Now, when I am ready to have a Spanish version of my modules, I have to copy the contents of the en-US folder into es-US, rename the files to include the correct locale, zip up the folder and email it to the translator. With a handy batch file and using the cool command line WinZip add-on, I can do this in about a minute. When the translated files arrive, I unzip them back into the folder and I am done.

I am assigning each Speerio control a “Locale” property. Once set, this will ensure that the correct language file is read and cached (by a class that inherits from DictionaryBase and caches based on a filedependency on the xml file). The property also

I am not sure my way is better. From a performance standpoint, there is no difference since after first request strings are read from cache. But I do think my way is easier to manager and more intuitive. Besides it gets me localization in DNN 2.x and DNN 3.x.

 

Founder NftyDreams; founder Decentology; co-founder DNN Software; educator; Open Source proponent; Microsoft MVP; tech geek; creative thinker; husband; dad. Personal blog: http://www.kalyani.com. Twitter: @techbubble
Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.