Last post Jul 09, 2008 03:53 PM by dtromp
Jul 05, 2008 11:23 AM|dtromp|LINK
I am writing a multi language enabled website (English and Dutch) using Visual Studio 2005 ASP.NET 2.0. It all works fine using resource files so I don't really have a problem but I do have a question.
A lot of controls come with default value's in English. Take for instance the CreateUserWizard. It has default value's for certain error messages like "The e-mail address that you entered is already in use. Please enter a different e-mail address."
When I start using a resource file for this control, the default value gets lost whereas I want to keep it as my default language, English.
The only way that I have found to come around this behavior is by creating a resource neutral file for that page and then copy & paste the default error messages of the control into the resource file but that creates a lot of extra work for English error
messages that already exist.
There must be a better way around this. Please help.
Jul 08, 2008 08:25 AM|pbb|LINK
How about checking the user language and only if it is not English, override the default texts with texts from your resource files, in code-behind?
But be careful that the default texts are localized by the server, so if you would copy your code over to a Dutch server, the dialogs would default to Dutch texts. So to be completely sure, you would have to perform a check if the user is using the same
language as the server, and if not then load texts from the resource files...
I think it is easier to just throw all those default texts overboard and put everything in your resource files. Microsoft made a very badly thought-through concept of having text defined by the control, but I guess that is not their first bad move ;-)
Maybe this will also help: http://sogeti-phoenix.com/Blogs/category/ASPNET-Login-Control.aspx
Jul 09, 2008 03:53 PM|dtromp|LINK
Thanks, that certainly is an option.
Is anyone aware of an other options that I should consider?