Doug L.
Doug L.

Reputation: 2716

Internationalization: Should I use resources or MVP for labels?

I'm building C# WinForms using the MVP pattern in VS 2008. I will migrate these to WPF in the future. These forms will need to support multiple languages for the input labels and menus. I want to store the label text in a SQL Server database and pull up the proper label based on language.

Which of thse options (or another option perhaps) would you use?

Upvotes: 0

Views: 479

Answers (1)

Gregory A Beamer
Gregory A Beamer

Reputation: 17010

As you are aiming at changing UI at some time in the future, you should keep the presentation layer as thin as possible, to avoid writing a lot of extra code. With this in mind, slapping your globalization/localization code in the presenter is not a great idea. A custom provider for the built-in resource management is a better option than loading the presenter, IMO.

Look at Michele Bustamante's articles on globalization on MSDN. As far as whether or not to store the localized strings in SQL Server, you will have to decide this, as resource files can be used in a wide variety of project types. I will have to find her article on building a custom globalization provider.

A quick google finds this article: http://www.codeproject.com/KB/aspnet/customsqlserverprovider.aspx?fid=308557&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=1619351

I have not played with the code, but it appears to be a good start.

Upvotes: 1

Related Questions