Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8951479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:40:24+00:00 2026-06-15T13:40:24+00:00

I would like to change the default ErrorMessage which we get on validation in

  • 0

I would like to change the default ErrorMessage which we get on validation in Entity Framework 4.3. We found LanguagePacks for EF4.1 but aren’t there any LanguagePacks for 4.3 available?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:40:25+00:00Added an answer on June 15, 2026 at 1:40 pm

    We solved this issue by manually translating all the validation messages we came across!
    We used some regular expressions to extract the message-resource string from the final error message.

        private static Dictionary<string, string> _errorTranslation;
    
        private static string TranslateErrorMessage(string errorMessage)
        {
            if (_errorTranslation == null)
            {
                _errorTranslation = new Dictionary<string, string>();
    
                // MaxLength-Attribute
                _errorTranslation.Add(
                    @"^The field (.*) must be a string or array type with a maximum length of (.*)\.$",
                    @"Das Feld $1 hat eine maximale Länge von $2.");
    
                // MinLength-Attribute
                _errorTranslation.Add(
                    @"^The field (.*) must be a string or array type with a minimum length of (.*)\.$",
                    @"Das Feld $1 hat eine minimale Länge von $2.");
    
                // StringLength-Attribute
                _errorTranslation.Add(
                    @"^The field (.*) must be a string with a maximum length of (.*)\.$",
                    @"Das Feld $1 hat eine maximale Länge von $2.");
    
                // Range-Attribute
                _errorTranslation.Add(
                    @"^The field (.*) must be between (.*) and (.*)\.$",
                    @"Das Feld $1 muss zwichen $2 und $3 liegen.");
    
                // Required-Attribute
                _errorTranslation.Add(
                    @"^The (.*) field is required\.$",
                    @"Das Feld $1 wird zwingend benötigt.");
            }
    
            foreach (var pattern in _errorTranslation)
                if (Regex.IsMatch(errorMessage, pattern.Key))
                    return Regex.Replace(errorMessage, pattern.Key, pattern.Value);
    
            return errorMessage;
        }
    

    edit
    Since nobody answered since I posted my question 5 month ago we came with this bad solution. Is it a shame to ask, why am I voted down for this?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to change the default blank tab icons in Komodo, but couldn't
I would like to change the default style for vector features in a map
I would like to change my default route values. Right now, I have: routes.MapRoute(
I would like to change visual studio's default configurations (Debug,Release). That is, change the
I would like to change the cursor from default to pointer when the mouse
I would like to change the color of buttons in Visual Studio 2010. But
I would like to change the default behavior of Zend_Form, so that whenever the
While making a WPF application I would like to change the default FocusVisualStyle (the
I would like to change the value of RequestQueue elemt under @sorregion name[.='default'] to
The default ErrorMessage for StringLength validation is a lot longer than I'd like: The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.