B2C Custom Policy Translations for Required Fields on SignUp page Not Translatable

Johnson, Mark IT 5 Reputation points
2023-09-22T22:07:16.22+00:00

Hi Folks,

Using Custom Policy for Signup process. We have translations for 9 languages and several required fields. However the translations are not working for required fields. What I get is "{field-type} is required" (screen shot below).

On this page https://learn.microsoft.com/en-us/azure/active-directory-b2c/localization-string-ids it indicates that a field is available:

"required_field_descriptive" default is "{0} is required"

I added this (among other items) to the LOCALIZATION.xml file

<LocalizedResources Id="api.localaccountsignup.en">
<LocalizedStrings>
<LocalizedString ElementType="UxElement" StringId="required_field_descriptive">{0} is required!</LocalizedString>

But upon upload I get this error:

Validation failed: 1 validation error(s) found in policy "B2C_1A_TRUSTFRAMEWORKLOCALIZATION" of tenant "myopcoid.onmicrosoft.com".The localized string with ElementType: UxElement and StringId: required_field_descriptive has an invalid StringId

page layout is using version 2.1.19

<ContentDefinition Id="api.localaccountsignup">
				<LoadUri>https://cmsdev.xxx.com/en/azureb2c/sign-up</LoadUri>
				<RecoveryUri>~/common/default_page_error.html</RecoveryUri>
				<DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.1.19</DataUri>
				<Metadata>
					<Item Key="DisplayName">Local account sign up page</Item>
				</Metadata>
			</ContentDefinition>

User's image

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,650 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Shweta Mathur 27,711 Reputation points Microsoft Employee
    2023-09-25T07:10:40.9+00:00

    Hi @Johnson, Mark IT ,

    Thanks for reaching out.

    I tried to reproduce the scenario and was able to upload the localization xml file successfully.

    The content definition you are passing is not correct for "api.localaccountsignup"

    It should be as below:

     <ContentDefinition Id="api.localaccountsignup">
    				<RecoveryUri>~/common/default_page_error.html</RecoveryUri>
    				<DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.1.19</DataUri>
    				<Metadata>
    					<Item Key="DisplayName">Local account sign up page</Item>
    				</Metadata>
             <LocalizedResourcesReferences MergeBehavior="Prepend">
              <LocalizedResourcesReference Language="en" LocalizedResourcesReferenceId="api.localaccountsignup.en" />
              <!-- Add more languages here -->
            </LocalizedResourcesReferences>
    			</ContentDefinition>
    

    The content definition contains a LocalizedResourcesReferences element that specifies a list of localized resources to load.

    Hope this will help.

    Thanks,

    Shweta


    Please remember to "Accept Answer" if answer helped you.


  2. Saroj Kumar Nanda 0 Reputation points
    2023-11-02T12:57:44.5533333+00:00

    Can you please try updating selfasserted page version in datauri section to latest version (2.1.26)
    User's image

    0 comments No comments