Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Olivia Philomena Moser 10 posts 91 karma points
    Feb 22, 2024 @ 10:53
    Olivia Philomena Moser
    0

    Change member registration validation language

    I followed the Umbraco documentation to create a member registration and login (members-registration-and-login). I added some custom fields to the registration. As I was checking the validation of the fields, I recognized, that the validation errors are all in English, but I need them to be in German. I'm looking for a proper way to overwrite the errors or to simply change the language.

    I tried to use "data-val-required" but this only works for the fields that are pre-set but not for my custom fields.

    Since I have custom fields, the Register Model doesn't contain them, and I can't set the error text in the Model.

    I'm using Umbraco V 13

        @if (registerModel.MemberProperties != null)
        {
            for (var i = 0; i < registerModel.MemberProperties.Count; i++)
            {
                <div class="mb-3">
                    @Html.LabelFor(m => registerModel.MemberProperties[i].Value, registerModel.MemberProperties[i].Name + "*")  @* Here *@
                    <input asp-for="@registerModel.MemberProperties[i].Value" class="form-control" aria-required="true" required />  @* Here *@
                    @Html.HiddenFor(m => registerModel.MemberProperties[i].Alias)
                    <span asp-validation-for="@registerModel.MemberProperties[i].Value" class="form-text text-danger"></span>
                </div>
            }
        }
    
Please Sign in or register to post replies

Write your reply to:

Draft