我的依赖方构建块部分有以下声明类型:
<ClaimType Id="extension_mfaByPhoneOrEmail">
<DisplayName>Please select your preferred MFA method</DisplayName>
<DataType>string</DataType>
<UserInputType>RadioSingleSelect</UserInputType>
<Restriction>
<Enumeration Text="Phone" Value="phone" SelectByDefault="true" />
<!-- <Enumeration Text="Email " Value="email" SelectByDefault="false" /> -->
</Restriction>
</ClaimType>
我无法添加其他语言的本地化,我已经设置了 trustframeworklocalization.xml 文件,它适用于代码的其他部分。
问题已部分解决,我在自断言内容定义 id 上添加了以下行:
<!-- Self Asserted localized strings (English) -->
<LocalizedResources Id="api.selfasserted.en">
<LocalizedStrings>
<LocalizedString ElementType="ClaimType" ElementId="extension_mfaByPhoneOrEmail" StringId="DisplayName">Please select your preferred MFA method</LocalizedString>
</LocalizedStrings>
</LocalizedResources>
问题解决了,我在自断言内容定义 id 上添加了以下行:
<LocalizedResources Id="api.selfasserted.en">
<LocalizedCollections>
<LocalizedCollection ElementType="ClaimType" ElementId="extension_mfaByPhoneOrEmail" TargetCollection="Restriction">
<Item Text="Phone" Value="phone" />
<Item Text="Email" Value="email" />
</LocalizedCollection>
</LocalizedCollections>
<LocalizedStrings>
<LocalizedString ElementType="ClaimType" ElementId="extension_mfaByPhoneOrEmail" StringId="DisplayName">Please select your preferred MFA method</LocalizedString>
</LocalizedStrings>
</LocalizedResources>