Last post Jul 05, 2008 11:20 AM by dtromp
Jun 29, 2008 12:40 PM|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.
custom resource provider
Jul 03, 2008 04:40 AM|pbb|LINK
I am not sure I understand you correctly (and I'm not sure I am doing things in the best way) but I always have a "neutral resource file" for the default language, and specific resource files for all additional languages. For example App_LocalResources\Default.aspx.resx
for English, and App_LocalResources\Default.aspx.nl.resx for Dutch. This way anybody who is not Dutch, will get to see the English translations. And all resources that I forgot to translate to Dutch, will show up in English.
Error messages I code in this way:
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="NameInput"
ErrorMessage="<%$ Resources:NameRequired %>" Display="Dynamic">
Does that help?
Jul 05, 2008 11:20 AM|dtromp|LINK
That is the same that I am doing and that works just fine but the thing is that you still have to fill out the "neutral resource file". If you for example look at the login control of ASP.NET, you will see that it comes with default error messages in English
which work just fine. But as soon as you start linking the error messages up to the resource file like this:
%>" you loose the default error message. Potentiall you could copy and paste the default error message of the control into the resource file but that seems like
In other words, when you write a website in English without localization and then decide to add localization, you have to copy the current text of each label, button, error message etc. into a resource file. I was
hoping that there is a way around it.