Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
990 views
in Technique[技术] by (71.8m points)

azure ad b2c - Unable to translate "Verification code has been sent. Please copy it to the input box below." message

I'm unable to translate the text "Verification code has been sent. Please copy it to the input box below." on my Sing up page using Azure AD B2C.

I tried the solution on Cant customize the Verification code message, but it didn't work for me. I was able to translate all the other texts on the page, but not this one.

I tried doing the following with no success:

      <ContentDefinition Id="api.localaccountsignup">
        <LoadUri>~/tenant/templates/AzureBlue/selfAsserted.cshtml</LoadUri>
        <RecoveryUri>~/common/default_page_error.html</RecoveryUri>
        <DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.1.1</DataUri>
        <Metadata>
          <Item Key="DisplayName">Local account Signup</Item>
        </Metadata>
        <LocalizedResourcesReferences MergeBehavior="Prepend">
          <LocalizedResourcesReference Language="pt" LocalizedResourcesReferenceId="localaccountsignup.pt" />
        </LocalizedResourcesReferences>
      </ContentDefinition>
...
      <LocalizedResources Id="localaccountsignup.pt">
        <LocalizedStrings>
            <LocalizedString ElementType="UxElement" StringId="verification_control_code_sent">Test.</LocalizedString>
...

When I try inserting the code above, I get the error:

Validation failed: 1 validation error(s) found in policy "B2C_1A_PHONE_EMAIL_BASE" of tenant "MYWEBSITE.com".The localized string with ElementType: UxElement and StringId: verification_control_code_sent has an invalid StringIdThe localized string with ElementType: UxElement and StringId: verification_control_code_sent has an invalid StringId

Message

I tried a lot of other things too, with no success.

question from:https://stackoverflow.com/questions/66052232/unable-to-translate-verification-code-has-been-sent-please-copy-it-to-the-inpu

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Thanks and Please try and let us know if you need more information.

urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.0.0

and add "contract" into all content definition dataURIs like this, only selfasserted needs to be 2.0.0 https://docs.microsoft.com/en-us/azure/active-directory-b2c/contentdefinitions#migrating-to-page-layout

and then follow this https://docs.microsoft.com/en-us/azure/active-directory-b2c/javascript-samples#add-the-scriptexecution-element


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...