nuqneHdir and Qapla' - TechEd Samples
Partial Types with C#

Where to store localization information?

Localization information can be read from resource files, satellite assemblies, or the database.

After posting my example of a custom ResourceReader to read resources from the database, Patrick Steele asked my opinion when to use resource files/satellite assemblies/database entries.

The best option storing resources depends on the application type.

Windows Forms applications can use resource files or satellite assemblies. When to use what depends on the user/customer of the application. If it should be possible adding, changing resources for different languages just by using an editor (XML editor), resource files can be a good option. In most cases, satellite assemblies will be the better choice. With satellite assemblies resources are embedded in a binary format within a DLL. This makes the resources not so visible to the user, and faster access is possible.
If the Windows application is not using a database directly, there is no need to think about putting the localization entries into the database.

With Web applications, using resource files is not a good option. The ResourceManager locks resource files, so it is not possible to update them with a running ResourceManager. So the two options left are satellite assemblies, and reading resources from the database. Because with a web application, usually a database is used, reading resources from the database is a perfect option. However, my sample of a resource reader to read resources from a database is just a simple implementation to show how to implement a custom resource reader. Adding caching functionality would be an useful task that can increase performance and scalability.

With web applications we should also differentiate between localized control values and content. If the content is read from the database, so should be the localized content. Localized control values can be read from satellite assemblies.

The Enterprise Localization Toolkit takes an interesting approach to localize web applications. It has some web applications and tools that make it easier to localize controls (not the content), and allows creating satellite assemblies.

Christian

Comments

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

Roy Osherove

Wow. Thanks for the great post. I was recently faced with exactly that problem. Your post just helped clear things up a bit.

Can you recommend any other good localization resources?

Patrick Steele

Thanks for the follow-up post Christian. Very informative!

Christian Nagel's OneNotes

AUTHOR: Christian Nagel's OneNotes
IP: 000.000.000.000
DATE: 09/12/2003 08:29:00 AM

Alan Dean

AUTHOR: Alan Dean
IP: 000.000.000.000
DATE: 09/27/2003 05:02:00 AM

Clemens Vasters

Just a note: dasBlog uses satellite assemblies, is an ASP.NET application and that combination works brilliantly -- also for xcopy updates.

Jane

Great information. Thanks for sharing.

The comments to this entry are closed.