3

I have to localize a sign-up, and a password reset custom policy in German, and I have a few questions regarding that:

  1. There seem to be no default translation for the "Missing required element: {0}" error, which shows when I for example enter a whitespace in my Verification Code textbox, and click "Verify":

enter image description here

I have then added this line to my localization file in order to add my own text:

<LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfMissingRequiredElement">Fehlendes erforderliches Element: {0}</LocalizedString>

This works somewhat, however, it ends up showing me the this error message, where you can see the placeholder ({0}) is not filled:

enter image description here

According to the Microsoft documentation, the {0} placeholder should be the right one to use here.

  1. Similarly, I am trying to add custom texts to the errors around the input fields, e.g.

enter image description here

and for Verification Code:

enter image description here

There's a business requirement that e.g. "Email" should be called "E-Mail-Adresse" in the flow, but when using the LocalizedString:

<LocalizedString ElementType="UxElement" StringId="required_field_descriptive">{0} ist erforderlich.</LocalizedString>

the placeholder seems to be taking the type of the input field rather than the DisplayName of the ClaimType, as otherwise stated in the documentation. Can I customize the texts being inserted into the placeholders, so that I can for example show "E-Mail-Adresse ist erforderlich." and "Verification code ist erforderlich.", respectively?

I am using selfasserted:2.1.19 pages for both flows.

Jonasgj
  • 63
  • 3
  • Are you looking to customize the error codes of input fields or input field names? – ShwetaM Mar 31 '23 at 12:11
  • Thanks for responding, @ShwetaM. The input field names are fine. For issue 1, I'm having issues with the custom policy not picking up the input field name that I have given the field, when using the {0} placeholder in a translation. It is picking up the input field name just fine when not adding my own translation, here the whole text just isn't localized. For issue 2, it seems that the {0} placeholder is taking the input field type as input, rather than the input field name, which I would have expected. This is denying me from being able to translate the part picked up by the {0} placeholder. – Jonasgj Apr 14 '23 at 09:58

0 Answers0