gpt4 book ai didi

azure-ad-b2c - 自定义策略 Azure B2C 中的本地化

转载 作者:行者123 更新时间:2023-12-04 08:56:35 25 4
gpt4 key购买 nike

我已经本地化了 DisplayName 和 UserHelpText(如下所示)。如何本地化电子邮件模式帮助文本(“您提供的电子邮件无效”)?请指教

<ClaimType Id="signInName">
<DisplayName>Please enter your email</DisplayName>
<DataType>string</DataType>
<UserHelpText>Enter your email address to signin</UserHelpText>
<Restriction>
<Pattern RegularExpression="^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$" HelpText="The email you provided is not valid"/>
</Restriction>
</ClaimType>

<Localization Enabled="true">
<SupportedLanguages DefaultLanguage="en" MergeBehavior="ReplaceAll">
<SupportedLanguage>en</SupportedLanguage>
<SupportedLanguage>es</SupportedLanguage>
</SupportedLanguages>
<LocalizedResources Id="en">
<LocalizedStrings>
<LocalizedString ElementType="ClaimType" ElementId="signInName" StringId="DisplayName">Please enter your email</LocalizedString>
<LocalizedString ElementType="ClaimType" ElementId="signInName" StringId="UserHelpText">Enter your email address to signin</LocalizedString>
</LocalizedStrings>
</LocalizedResources>
<LocalizedResources Id="es">
<LocalizedStrings>
<LocalizedString ElementType="ClaimType" ElementId="signInName" StringId="DisplayName">Por favor introduzca su correo electrónico</LocalizedString>
<LocalizedString ElementType="ClaimType" ElementId="signInName" StringId="UserHelpText">Ingrese su dirección de correo electrónico para iniciar sesión</LocalizedString>
</LocalizedStrings>
</LocalizedResources>
</Localization>

最佳答案

对于无效的电子邮件 ID,您可以使用内置 invalid_email UXElement 并添加以下 LocalizedString :

<LocalizedString ElementType="UxElement" StringId="invalid_email">#Please enter a valid email address</LocalizedString>
引用文档:
  • https://docs.microsoft.com/en-us/azure/active-directory-b2c/custom-policy-localization
  • https://medium.com/the-new-control-plane/customising-the-message-error-text-in-azure-ad-b2c-custom-policies-d1e1ff2640d3
  • 关于azure-ad-b2c - 自定义策略 Azure B2C 中的本地化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63799246/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com