0

B2C 多语言问题,我将语言设置为“gu”,即古吉拉特语,内容转换为“gu”,但成功/失败消息以英语显示。我希望它在“gu”中。

在此处输入图像描述

4

1 回答 1

0

根据 > Azure Active Directory B2C 中的用户流和自定义策略

用户流是我们提供的预定义、内置、可配置策略,因此您可以在几分钟内创建注册、登录和策略编辑体验。

自定义策略使您能够为复杂的身份体验场景创建自己的用户旅程

在此处输入图像描述

本地化元素允许您在用户旅程的策略中支持多种语言环境或语言。策略中的本地化支持允许您:

• 在策略中设置支持语言的明确列表并选择默认语言。

• 提供特定语言的字符串和集合。

在此处输入图像描述

使用验证显示控件来验证声明,例如电子邮件地址或电话号码,并向用户发送验证码。(参考

在此处输入图像描述

请参阅代码本地化字符串 ID - Azure Active Directory B2C 和默认值,并在自定义策略中为首选语言自定义语言。

<LocalizedResources Id="api.localaccountsignup.gu">
   <LocalizedStrings>
       <LocalizedString ElementType="DisplayControl" ElementId="emailVerificationControl" StringId="success_send_code_msg">Customize the error message in gujarati</LocalizedString>

//for error messages you can use element type as ErrorMessage
    <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsPrincipalDoesNotExist">Your customized error message in language enabled</LocalizedString>

   <!-- Display control UI elements-->
    <LocalizedString ElementType="DisplayControl" ElementId="emailVerificationControl" StringId="intro_msg"> Customize the error message in gujarati </LocalizedString>

  </LocalizedStrings>
</LocalizedResources>

请在此处检查此Azure b2c 自定义策略错误消息 - Microsoft Q&A和类似问题,这可能会提供一个想法。

将查询参数 ui_locales=en 作为身份验证请求的一部分传递。将其替换为首选语言作为终点的一部分。

其他参考: customising-the-message-error-text-in-azure-ad-b2c-custom-policies

于 2021-09-07T14:01:00.000 回答