How do you localize a database driven website

.net, asp.net, c#, localization

Solution

In my opinion, localizing dynamic content (e.g., your FAQ) should be done by you in your database. Depending on how your questions are stored, I would probably create a "locale" column and use that when selecting the FAQ questions from the database. I'm not sure if this would scale very well when you started localizing lots of tables.

For static content (e.g, form field labels, static text, icons, etc) you should probably be just fine using file-based resources. If you really wanted to, however, it looks like it wouldn't be super hard to create a custom resource provider implementation that could handle this.

Here's some related links:

- http://channel9.msdn.com/forums/Coffeehouse/250892-Localizing-with-a-database-or-resx-files/

- http://weblogs.asp.net/scottgu/archive/2006/05/30/ASP.NET-2.0-Localization-_2800_Video_2C00_-Whitepaper_2C00_-and-Database-Provider-Support_2900_.aspx

- http://www.arcencus.nl/Blogs/tabid/105/EntryID/20/Default.aspx

- http://msdn.microsoft.com/en-us/library/aa905797.aspx

- http://www.codeproject.com/KB/aspnet/customsqlserverprovider.aspx

Problem

I've been playing with the .NET built in localization features and they seem to all rely on putting data in resx files. But most systems can't rely on this because they are database driven. So how do you solve this issue? Is there a built in .NET way, or do you create a translations table in SQL and do it all manually? And if you have to do this on the majority of your sites, is there any reason to even use the resx way of localization? An example of this is I have an FAQ list on my site, I keep this list in the database so I can easily add/remove more, but by putting it in the database, I have no good way have translating this information into multiple languages.

Original source

Related problems