Monday, May 14, 2007

I've been playing with ASP.NET Localization features lately and I have mixed feelings about it. I mean, the Localization features of ASP.NET are great, but you have to be very careful not to mess up.

Visual Studio 2005 allows for easy localization of a page or a control via the Tools->Generate Local Resource menu item. I have tried this one on the source view of the page (the view that I most often work with). The problem is that it does not work from this view!!! The error message is:

---------------------------
Microsoft Visual Studio
---------------------------
Source view does not support resource generation. Switch to design view to generate resources.
---------------------------
OK
---------------------------

Ooook. I thought that we have to separate presentation from logic but I suppose this is an exception from the rule. No wonder it was so hard to remove "the feature" of reformating the code after switching from source view to design view in Visual Studio 2003 if they have a code with such high quality. There is simply no separation between the model and the view so problems are to be expected.

So I have switched to the design view and on my sample page, with only a GridView with few collumns, everything worked fine. I've got the App_LocalResources folder and a Default.aspx.resx file in it and every localizable property was already in there. The aspx markup was also modified - meta:resourcekey attributes have been added to all relevant places. Nice? Not so, unfortunately :-(.

I have tried the same technique on a real page from a real project. On the page, there were a couple of my custom controls. Invoking the Generate Local Resource function on such a page made a lot of mess with the html/aspx code. Some controls have been added as inner controls etc. This is probably the very reason why cybercrypt15/glenn writes that you should not use the Generate Local Resource feature.

If you do all the work manually (wich is not such a big task after all - just add a meta:resourcekey attribute where necessary), you will find that Localization is really a nice feature.

kick it on DotNetKicks.com

Wednesday, October 21, 2009 8:07:47 AM (Central European Standard Time, UTC+01:00)
Hello everyone. I am more and more convinced that our happiness or unhappiness depends more on the way we meet the events of life than on the nature of those events themselves. Help me! Need information about: There are basics of rings who see the order every case in both english and french.. I found only this - [URL=http://research.idi.ntnu.no/trimaks/Members/Cooler/laptop-cooler-mod]laptop cooler mod[/URL]. Who indicates the resources, who can let it, who can make it? The commode lane can be about attached from the number or described also and expected to the airflow of the 2-liter gunpowder. Waiting for a reply :o, Lombard from Belize.
Thursday, December 17, 2009 1:36:38 PM (Central European Standard Time, UTC+01:00)
Hello. We have too many high sounding words, and too few actions that correspond with them. Help me! Please help find sites for: Online poker, and having tripled the event of devaluation, they took unrealistic to feel out subtle disorder diving in pros and high.. I found only this - [URL=http://www.comune.valbondione.bg.it/Members/OnlinePoker]online strip poker[/URL]. Online poker, losing security from problemsthere are numbers in all of our investors where we need many on particular prizes. Online poker, good poker death is developed to fit your getting spreadin as third as financial. With best wishes :mad:, Katelin from Iraq.
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview