Azure Active Directory B2C 中的语言自定义Language customization in Azure Active Directory B2C

开始之前,请使用上面的选择器选择要配置的策略类型。Before you begin, use the selector above to choose the type of policy you’re configuring. Azure AD B2C 提供了两种定义用户如何与应用程序交互的方法:通过预定义的用户流,或者通过完全可配置的自定义策略Azure AD B2C offers two methods of defining how users interact with your applications: though predefined user flows, or through fully configurable custom policies. 对于每种方法,本文中所需的步骤都不同。The steps required in this article are different for each method.

用户流可以使用 Azure Active Directory B2C (Azure AD B2C) 中的语言自定义来适应不同的语言,从而满足客户需求。Language customization in Azure Active Directory B2C (Azure AD B2C) allows your user flow to accommodate different languages to suit your customer needs. Microsoft 提供 36 种语言的翻译,但你也可以为任何语言提供自己的翻译。Microsoft provides the translations for 36 languages, but you can also provide your own translations for any language. 即使体验是针对一种语言提供的,也可以自定义页面上的任何文本。Even if your experience is provided for only a single language, you can customize any text on the pages.

语言自定义的工作原理How language customization works

通过语言自定义可选择用户流可用于的语言。You use language customization to select which languages your user flow is available in. 启用该功能后,可以从应用程序提供查询字符串参数 ui_localesAfter the feature is enabled, you can provide the query string parameter, ui_locales, from your application. 调用 Azure AD B2C 时,我们会根据指定的区域设置翻译页面。When you call into Azure AD B2C, your page is translated to the locale that you have indicated. 使用此配置类型可以完全控制用户流中的语言,并忽略客户浏览器的语言设置。This type of configuration gives you complete control over the languages in your user flow and ignores the language settings of the customer's browser.

可能不需要对客户看到的语言拥有这种控制度。You might not need that level of control over what languages your customer sees. 如果未提供 ui_locales 参数,客户的体验由其浏览器设置确定。If you don't provide a ui_locales parameter, the customer's experience is dictated by their browser's settings. 仍可以控制要将用户流翻译成哪种语言,只需将该语言添加为支持的语言即可。You can still control which languages your user flow is translated to by adding it as a supported language. 如果客户浏览器设置为显示你不希望支持的语言,则将改为显示你在受支持区域性中选为默认的语言。If a customer's browser is set to show a language that you don't want to support, then the language that you selected as a default in supported cultures is shown instead.

  • ui-locales 指定的语言:启用语言自定义后,用户流将翻译成此处指定的语言。ui-locales specified language: After you enable language customization, your user flow is translated to the language that's specified here.
  • 浏览器请求的语言:如果未指定 ui_locales 参数,用户流将翻译成浏览器请求的语言(如果该语言受支持)。Browser-requested language: If no ui_locales parameter was specified, your user flow is translated to the browser-requested language, if the language is supported.
  • 策略默认语言:如果浏览器未指定语言,或者指定了不支持的语言,用户流将翻译成用户流默认语言。Policy default language: If the browser doesn't specify a language, or it specifies one that is not supported, the user flow is translated to the user flow default language.


如果使用自定义用户属性,需要提供自己的翻译。If you're using custom user attributes, you need to provide your own translations. 有关详细信息,请参阅自定义字符串For more information, see Customize your strings.

本地化需要三个步骤:Localization requires three steps:

  1. 设置受支持语言的显式列表Set-up the explicit list of supported languages
  2. 提供特定于语言的字符串和集合Provide language-specific strings and collections
  3. 编辑页面的内容定义Edit the content definition for the page.


支持 ui_locales 请求的语言Support requested languages for ui_locales

在语言自定义正式版发布之前创建的策略将需要先启用此功能。Policies that were created before the general availability of language customization need to enable this feature first. 之后创建的策略和用户流默认情况下已启用语言自定义。Policies and user flows that were created after have language customization enabled by default.

在用户流中启用语言自定义后,可以通过添加 ui_locales 参数来控制用户流的语言。When you enable language customization on a user flow, you can control the language of the user flow by adding the ui_locales parameter.

  1. 在 Azure AD B2C 租户中,选择“用户流”。In your Azure AD B2C tenant, select User flows.
  2. 单击想要启用翻译的用户流。Click the user flow that you want to enable for translations.
  3. 选择“语言”。Select Languages.
  4. 选择“启用语言自定义”。Select Enable language customization.

选择要在用户流中启用的语言Select which languages in your user flow are enabled

为用户流启用一组语言,以便在无 ui_locales 参数的浏览器提出请求时翻译成这些语言。Enable a set of languages for your user flow to be translated to when requested by the browser without the ui_locales parameter.

  1. 确保已根据前面的说明为用户流启用语言自定义。Ensure that your user flow has language customization enabled from previous instructions.
  2. 在用户流的“语言”页面,选择想要支持的语言。On the Languages page for the user flow, select a language that you want to support.
  3. 在属性窗格中,将“已启用”更改为“是”。 In the properties pane, change Enabled to Yes.
  4. 选择属性窗格顶部的“保存”。Select Save at the top of the properties pane.


如果未提供 ui_locales 参数,则仅当客户的浏览器语言已启用时,才将页面翻译成此语言If a ui_locales parameter is not provided, the page is translated to the customer's browser language only if it is enabled.

自定义字符串Customize your strings

使用语言自定义可以自定义用户流中的任何字符串。Language customization enables you to customize any string in your user flow.

  1. 确保已根据前面的说明为用户流启用语言自定义。Ensure that your user flow has language customization enabled from the previous instructions.
  2. 在用户流的“语言”页面,选择想要自定义的语言。On the Languages page for the user flow, select the language that you want to customize.
  3. 在“页面级别资源文件”下,选择想要编辑的页面。Under Page-level-resources files, select the page that you want to edit.
  4. 选择“下载默认值”(如果以前已编辑这种语言,则选择“下载重写”)。 Select Download defaults (or Download overrides if you have previously edited this language).

执行这些步骤可以创建用于开始编辑字符串的 JSON 文件。These steps give you a JSON file that you can use to start editing your strings.

更改页面上的任何字符串Change any string on the page

  1. 在 JSON 编辑器中打开根据前面的说明下载的 JSON 文件。Open the JSON file downloaded from previous instructions in a JSON editor.
  2. 找到想要更改的元素。Find the element that you want to change. 可以查找所需字符串的 StringId,或者查找想要更改的 Value 属性。You can find StringId for the string you're looking for, or look for the Value attribute that you want to change.
  3. 使用想要显示的内容更新 Value 属性。Update the Value attribute with what you want displayed.
  4. 对于每个要更改的字符串,将 Override 更改为 trueFor every string that you want to change, change Override to true.
  5. 保存文件并上传更改。Save the file and upload your changes. (可在下载 JSON 文件的同一位置找到上传控件。)(You can find the upload control in the same place as where you downloaded the JSON file.)


如果需要重写字符串,请确保将 Override 值设置为 trueIf you need to override a string, make sure to set the Override value to true. 如果未更改该值,将忽略该条目。If the value isn't changed, the entry is ignored.

更改扩展属性Change extension attributes

若要更改自定义用户属性的字符串或者想要在 JSON 中添加一个字符串,该字符串需采用以下格式:If you want to change the string for a custom user attribute, or you want to add one to the JSON, it's in the following format:

  "LocalizedStrings": [
      "ElementType": "ClaimType",
      "ElementId": "extension_<ExtensionAttribute>",
      "StringId": "DisplayName",
      "Override": true,
      "Value": "<ExtensionAttributeValue>"

<ExtensionAttribute> 替换为自定义用户属性的名称。Replace <ExtensionAttribute> with the name of your custom user attribute.

<ExtensionAttributeValue> 替换为要显示的新字符串。Replace <ExtensionAttributeValue> with the new string to be displayed.

使用 LocalizedCollections 提供值列表Provide a list of values by using LocalizedCollections

若要为响应提供一组值列表,需要创建 LocalizedCollections 属性。If you want to provide a set list of values for responses, you need to create a LocalizedCollections attribute. LocalizedCollectionsNameValue 对的数组。LocalizedCollections is an array of Name and Value pairs. 项目的顺序将是它们显示的顺序。The order for the items will be the order they are displayed. 若要添加 LocalizedCollections,请使用以下格式:To add LocalizedCollections, use the following format:

  "LocalizedStrings": [...],
  "LocalizedCollections": [
      "Override": true,
  • ElementId 是此 LocalizedCollections 属性响应的用户属性。ElementId is the user attribute that this LocalizedCollections attribute is a response to.
  • Name 是向用户显示的值。Name is the value that's shown to the user.
  • Value 是选择此选项时要在声明中返回的内容。Value is what is returned in the claim when this option is selected.

上传更改Upload your changes

  1. 完成对 JSON 文件的更改后,返回到 B2C 租户。After you complete the changes to your JSON file, go back to your B2C tenant.
  2. 选择“用户流”,单击想要启用翻译的用户流。Select User flows and click the user flow that you want to enable for translations.
  3. 选择“语言”。Select Languages.
  4. 选择要翻译成的语言。Select the language that you want to translate to.
  5. 选择想要提供翻译的页面。Select the page where you want to provide translations.
  6. 选择文件夹图标,选择要上传的 JSON 文件。Select the folder icon, and select the JSON file to upload.

更改将自动保存到用户流。The changes are saved to your user flow automatically.

使用语言自定义来自定义页面 UICustomize the page UI by using language customization

可通过两种方法本地化 HTML 内容There are two ways to localize your HTML content. 一种方法是启用语言自定义One way is to turn on language customization. 启用此功能可让 Azure AD B2C 将 OpenID Connect 参数 ui-locales 转发到终结点。Enabling this feature allows Azure AD B2C to forward the OpenID Connect parameter, ui-locales, to your endpoint. 内容服务器可使用此参数提供特定语言的自定义 HTML 页面。Your content server can use this parameter to provide customized HTML pages that are language-specific.

或者,可以基于所用的区域设置从不同位置拉取内容。Alternatively, you can pull content from different places based on the locale that's used. 在已启用 CORS 的终结点中,可以设置文件夹结构以托管特定语言的内容。In your CORS-enabled endpoint, you can set up a folder structure to host content for specific languages. 如果使用通配符值 {Culture:RFC5646},则会调用正确的语言。You'll call the right one if you use the wildcard value {Culture:RFC5646}. 例如,假设自定义页 URI 如下:For example, assume that this is your custom page URI:{Culture:RFC5646}/wingtip/unified.html

可以在 fr 中加载页面。You can load the page in fr. 当页面拉取 HTML 和 CSS 内容时,将从以下项拉取:When the page pulls HTML and CSS content, it's pulling from:

添加自定义语言Add custom languages

还可以添加 Microsoft 目前未为其提供翻译的语言。You can also add languages that Microsoft currently does not provide translations for. 需要为用户流中的所有字符串提供翻译。You'll need to provide the translations for all the strings in the user flow. 语言和区域设置代码仅限于 ISO 639-1 标准中的代码。Language and locale codes are limited to those in the ISO 639-1 standard. 区域设置代码格式应为“ISO_639-1_code”-“CountryCode”,例如 en-GBThe locale code format should be "ISO_639-1_code"-"CountryCode", for example en-GB. 有关区域设置 ID 格式的详细信息,请参阅 more information on locale ID formats, please refer to

  1. 在 Azure AD B2C 租户中,选择“用户流”。In your Azure AD B2C tenant, select User flows.
  2. 单击想要添加自定义语言的用户流,然后单击“语言”。Click the user flow where you want to add custom languages, and then click Languages.
  3. 从页面顶部选择“添加自定义语言”。Select Add custom language from the top of the page.
  4. 在打开的上下文窗格中,通过输入有效的区域设置代码确定要为其提供翻译的语言。In the context pane that opens, identify which language you're providing translations for by entering a valid locale code.
  5. 对于每个页,可以下载一组英语重写,并处理翻译。For each page, you can download a set of overrides for English and work on the translations.
  6. 完成 JSON 文件后,可为每个页面上传这些文件。After you're done with the JSON files, you can upload them for each page.
  7. 选择“启用”,用户流即可为用户显示此语言。Select Enable, and your user flow can now show this language for your users.
  8. 保存语言。Save the language.


在保存之前,你需要启用自定义语言或上传替代语言。You need to either enable the custom languages or upload overrides for it before you can save.

设置支持的语言的列表Set up the list of supported languages

打开策略的扩展文件。Open the extensions file of your policy. 例如,SocialAndLocalAccounts/``TrustFrameworkExtensions.xmlFor example, SocialAndLocalAccounts/TrustFrameworkExtensions.xml.

  1. 搜索 BuildingBlocks 元素。Search for the BuildingBlocks element. 如果该元素不存在,请添加该元素。If the element doesn't exist, add it.
  2. 添加包含支持的语言的 Localization 元素:英语(默认)和西班牙语。Add the Localization element with the supported languages: English (default) and Spanish.
<Localization Enabled="true">
  <SupportedLanguages DefaultLanguage="en" MergeBehavior="ReplaceAll">

提供特定于语言的标签Provide language-specific labels

Localization 元素的 LocalizedResources 包含本地化字符串的列表。The LocalizedResources of the Localization element contains the list of localized strings. 本地化资源元素具有用于唯一标识本地化资源的标识符。The localized resources element has an identifier that is used to uniquely identify localized resources. 此标识符稍后会在内容定义元素中使用。This identifer is used later in the content definition element.

你将为内容定义和要支持的任何语言配置本地化资源元素。You configure localized resources elements for the content definition and any language you want to support. 若要自定义适用于英语和西班牙语的统一注册或登录页面,请在 </SupportedLanguages> 元素结束后添加以下 LocalizedResources 元素。To customize the unified sign-up or sign-in pages for English and Spanish, you add the following LocalizedResources elements after the close of the </SupportedLanguages> element.


在下面的示例中,我们在每行的开头都添加了井字符号 #,以便你可以在屏幕上轻松找到本地化的标签。In the following sample we added the pound # symbol at the beginning of each line, so you can easily find the localized labels on the screen.

<!--Local account sign-up or sign-in page English-->
<Localization Enabled="true">
  <LocalizedResources Id="api.signuporsignin.en">
      <LocalizedString ElementType="UxElement" StringId="logonIdentifier_email">#Email Address</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="requiredField_email">#Please enter your email</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="logonIdentifier_username">#Username</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="password">#Password</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="createaccount_link">#Sign up now</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="requiredField_username">#Please enter your user name</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="createaccount_intro">#Don't have an account?</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="forgotpassword_link">#Forgot your password?</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="divider_title">#OR</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="cancel_message">#The user has forgotten their password</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="button_signin">#Sign in</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="social_intro">#Sign in with your social account</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="requiredField_password">#Please enter your password</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="invalid_password">#The password you entered is not in the expected format.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="local_intro_username">#Sign in with your user name</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="local_intro_email">#Sign in with your existing account</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="invalid_email">#Please enter a valid email address</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="unknown_error">#We are having trouble signing you in. Please try again later.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="email_pattern">^[a-zA-Z0-9.!#$%&amp;'^_`{}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfInvalidPassword">#Your password is incorrect.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsPrincipalDoesNotExist">#We can't seem to find your account.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfOldPasswordUsed">#Looks like you used an old password.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="DefaultMessage">#Invalid username or password.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfUserAccountDisabled">#Your account has been locked. Contact your support person to unlock it, then try again.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfUserAccountLocked">#Your account is temporarily locked to prevent unauthorized use. Try again later.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="AADRequestsThrottled">#There are too many requests at this moment. Please wait for some time and try again.</LocalizedString>
  <!--Local account sign-up or sign-in page Spanish-->
  <LocalizedResources Id="">
      <LocalizedString ElementType="UxElement" StringId="logonIdentifier_email">#Correo electrónico</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="requiredField_email">#Este campo es obligatorio</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="logonIdentifier_username">#Nombre de usuario</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="password">#Contraseña</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="createaccount_link">#Registrarse ahora</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="requiredField_username">#Escriba su nombre de usuario</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="createaccount_intro">#¿No tiene una cuenta?</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="forgotpassword_link">#¿Olvidó su contraseña?</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="divider_title">#O</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="cancel_message">#El usuario ha olvidado su contraseña</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="button_signin">#Iniciar sesión</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="social_intro">#Iniciar sesión con su cuenta de redes sociales</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="requiredField_password">#Escriba su contraseña</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="invalid_password">#La contraseña que ha escrito no está en el formato esperado.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="local_intro_username">#Iniciar sesión con su nombre de usuario</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="local_intro_email">#Iniciar sesión con su cuenta existente</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="invalid_email">#Escriba una dirección de correo electrónico válida</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="unknown_error">#Tenemos problemas para iniciar su sesión. Vuelva a intentarlo más tarde.  </LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="email_pattern">^[a-zA-Z0-9.!#$%&amp;'^_`{}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfInvalidPassword">#Su contraseña es incorrecta.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsPrincipalDoesNotExist">#Parece que no podemos encontrar su cuenta.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfOldPasswordUsed">#Parece que ha usado una contraseña antigua.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="DefaultMessage">#El nombre de usuario o la contraseña no son válidos.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfUserAccountDisabled">#Se bloqueó su cuenta. Póngase en contacto con la persona responsable de soporte técnico para desbloquearla y vuelva a intentarlo.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfUserAccountLocked">#Su cuenta se bloqueó temporalmente para impedir un uso no autorizado. Vuelva a intentarlo más tarde.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="AADRequestsThrottled">#Hay demasiadas solicitudes en este momento. Espere un momento y vuelva a intentarlo.</LocalizedString>
  <!--Local account sign-up page English-->
  <LocalizedResources Id="api.localaccountsignup.en">
      <LocalizedString ElementType="ClaimType" ElementId="email" StringId="DisplayName">#Email Address</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="email" StringId="UserHelpText">#Email address that can be used to contact you.</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="email" StringId="PatternHelpText">#Please enter a valid email address.</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="newPassword" StringId="DisplayName">#New Password</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="newPassword" StringId="UserHelpText">#Enter new password</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="newPassword" StringId="PatternHelpText">#8-16 characters, containing 3 out of 4 of the following: Lowercase characters, uppercase characters, digits (0-9), and one or more of the following symbols: @ # $ % ^ &amp; * - _ + = [ ] { } | \ : ' , ? / ` ~ " ( ) ; .</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="reenterPassword" StringId="DisplayName">#Confirm New Password</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="reenterPassword" StringId="UserHelpText">#Confirm new password</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="reenterPassword" StringId="PatternHelpText">#8-16 characters, containing 3 out of 4 of the following: Lowercase characters, uppercase characters, digits (0-9), and one or more of the following symbols: @ # $ % ^ &amp; * - _ + = [ ] { } | \ : ' , ? / ` ~ " ( ) ; .</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="displayName" StringId="DisplayName">#Display Name</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="displayName" StringId="UserHelpText">#Your display name.</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="surname" StringId="DisplayName">#Surname</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="surname" StringId="UserHelpText">#Your surname (also known as family name or last name).  </LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="givenName" StringId="DisplayName">#Given Name</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="givenName" StringId="UserHelpText">#Your given name (also known as first name).</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="button_continue">#Create</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="error_fieldIncorrect">#One or more fields are filled out incorrectly. Please check your entries and try again.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="error_passwordEntryMismatch">#The password entry fields do not match. Please enter the same password in both fields and try again.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="error_requiredFieldMissing">#A required field is missing. Please fill out all required fields and try again.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="helplink_text">#What is this?</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="initial_intro">#Please provide the following details.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="preloader_alt">#Please wait</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="required_field">#This information is required.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_but_edit">#Change e-mail</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_but_resend">#Send new code</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_but_send">#Send verification code</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_but_verify">#Verify code</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_fail_code_expired">#That code is expired. Please request a new code.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_fail_no_retry">#You've made too many incorrect attempts. Please try again later.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_fail_retry">#That code is incorrect. Please try again.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_fail_server">#We are having trouble verifying your email address. Please enter a valid email address and try again.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_fail_throttled">#There have been too many requests to verify this email address. Please wait a while, then try again.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_info_msg">#Verification code has been sent to your inbox. Please copy it to the input box below.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_input">#Verification code</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_intro_msg">#Verification is necessary. Please click Send button.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_success_msg">#E-mail address verified. You can now continue.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="ServiceThrottled">#There are too many requests at this moment. Please wait for some time and try again.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimNotVerified">#Claim not verified: {0}</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsPrincipalAlreadyExists">#A user with the specified ID already exists. Please choose a different one.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfIncorrectPattern">#Incorrect pattern for: {0}</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfInvalidInput">#{0} has invalid input.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfMissingRequiredElement">#Missing required element: {0}</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfValidationError">#Error in validation by: {0}</LocalizedString>
  <!--Local account sign-up page Spanish-->
  <LocalizedResources Id="">
      <LocalizedString ElementType="ClaimType" ElementId="email" StringId="DisplayName">#Dirección de correo electrónico</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="email" StringId="UserHelpText">#Dirección de correo electrónico que puede usarse para ponerse en contacto con usted.</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="email" StringId="PatternHelpText">#Introduzca una dirección de correo electrónico válida.  </LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="newPassword" StringId="DisplayName">#Nueva contraseña</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="newPassword" StringId="UserHelpText">#Escriba la contraseña nueva</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="newPassword" StringId="PatternHelpText">#De 8 a 16 caracteres, que contengan 3 de los 4 tipos siguientes: caracteres en minúsculas, caracteres en mayúsculas, dígitos (0-9) y uno o más de los siguientes símbolos: @ # $ % ^ &amp; * - _ + = [ ] { } | \\ : ' , ? / ` ~ \" ( ) ; .</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="reenterPassword" StringId="DisplayName">#Confirmar nueva contraseña</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="reenterPassword" StringId="UserHelpText">#Confirmar nueva contraseña</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="reenterPassword" StringId="PatternHelpText">#8 a 16 caracteres, que contengan 3 de los 4 tipos siguientes: caracteres en minúsculas, caracteres en mayúsculas, dígitos (0-9) y uno o más de los siguientes símbolos: @ # $ % ^ &amp; * - _ + = [ ] { } | \\ : ' , ? / ` ~ \" ( ) ; .</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="displayName" StringId="DisplayName">#Nombre para mostrar</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="displayName" StringId="UserHelpText">#Su nombre para mostrar.</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="surname" StringId="DisplayName">#Apellido</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="surname" StringId="UserHelpText">#Su apellido.</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="givenName" StringId="DisplayName">#Nombre</LocalizedString>
      <LocalizedString ElementType="ClaimType" ElementId="givenName" StringId="UserHelpText">#Su nombre (también conocido como nombre de pila).</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="button_continue">#Crear</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="error_fieldIncorrect">#Hay uno o varios campos rellenados de forma incorrecta. Compruebe las entradas y vuelva a intentarlo.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="error_passwordEntryMismatch">#Los campos de entrada de contraseña no coinciden. Escriba la misma contraseña en ambos campos y vuelva a intentarlo.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="error_requiredFieldMissing">#Falta un campo obligatorio. Rellene todos los campos necesarios y vuelva a intentarlo.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="helplink_text">#¿Qué es esto?</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="initial_intro">#Proporcione los siguientes detalles.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="preloader_alt">#Espere</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="required_field">#Esta información es obligatoria.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_but_edit">#Cambiar correo electrónico</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_but_resend">#Enviar nuevo código</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_but_send">#Enviar código de comprobación</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_but_verify">#Comprobar código</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_fail_code_expired">#El código ha expirado. Solicite otro nuevo.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_fail_no_retry">#Ha realizado demasiados intentos incorrectos. Vuelva a intentarlo más tarde.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_fail_retry">#Ese código es incorrecto. Inténtelo de nuevo.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_fail_server">#Tenemos problemas para comprobar la dirección de correo electrónico. Escriba una dirección de correo electrónico válida y vuelva a intentarlo.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_fail_throttled">#Ha habido demasiadas solicitudes para comprobar esta dirección de correo electrónico. Espere un poco y vuelva a intentarlo.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_info_msg">#Se ha enviado el código de verificación a su Bandeja de entrada. Cópielo en el siguiente cuadro de entrada.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_input">#Código de verificación</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_intro_msg">#La comprobación es obligatoria. Haga clic en el botón Enviar.</LocalizedString>
      <LocalizedString ElementType="UxElement" StringId="ver_success_msg">#Dirección de correo electrónico comprobada. Puede continuar.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="ServiceThrottled">#Hay demasiadas solicitudes en este momento. Espere un momento y vuelva a intentarlo.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimNotVerified">#Reclamación no comprobada: {0}</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsPrincipalAlreadyExists">#Ya existe un usuario con el id. especificado. Elija otro diferente.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfIncorrectPattern">#Patrón incorrecto para: {0}</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfInvalidInput">#{0} tiene una entrada no válida.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfMissingRequiredElement">#Falta un elemento obligatorio: {0}</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfValidationError">#Error en la validación de: {0}</LocalizedString>

通过本地化编辑内容定义Edit the content definition with the localization

粘贴作为 BuildingBlocks 元素的子元素复制的 ContentDefinitions 元素的全部内容。Paste the entire contents of the ContentDefinitions element that you copied as a child of the BuildingBlocks element.

在以下示例中,英语 (en) 和西班牙语 (es) 自定义字符串已添加到注册或登录页面,并已添加到本地帐户注册页面。In the following example, English (en) and Spanish (es) custom strings are added to the sign-up or sign-in page, and to the local account sign-up page. 每个 LocalizedResourcesReferenceLocalizedResourcesReferenceId 与其区域设置相同,但可将任何字符串用作标识符。The LocalizedResourcesReferenceId for each LocalizedResourcesReference is the same as their locale, but you could use any string as the identifier. 对于每个语言和页面组合,请指向前面创建的相应 LocalizedResourcesFor each language and page combination, you point to the corresponding LocalizedResources you previously created.

  <ContentDefinition Id="api.signuporsignin">
    <LocalizedResourcesReferences MergeBehavior="Prepend">
        <LocalizedResourcesReference Language="en" LocalizedResourcesReferenceId="api.signuporsignin.en" />
        <LocalizedResourcesReference Language="es" LocalizedResourcesReferenceId="" />

  <ContentDefinition Id="api.localaccountsignup">
    <LocalizedResourcesReferences MergeBehavior="Prepend">
        <LocalizedResourcesReference Language="en" LocalizedResourcesReferenceId="api.localaccountsignup.en" />
        <LocalizedResourcesReference Language="es" LocalizedResourcesReferenceId="" />

上传并测试已更新的自定义策略Upload and test your updated custom policy

上传自定义策略Upload the custom policy

  1. 保存扩展文件。Save the extensions file.
  2. 请确保使用包含 Azure AD B2C 租户的目录,方法是选择顶部菜单中的“目录 + 订阅”筛选器,然后选择包含租户的目录。Make sure you're using the directory that contains your Azure AD B2C tenant by selecting the Directory + subscription filter in the top menu and choosing the directory that contains your tenant.
  3. 搜索并选择“Azure AD B2C”。Search for and select Azure AD B2C.
  4. 在“策略”下,选择“Identity Experience Framework”。 Under Policies, select Identity Experience Framework.
  5. 选择“上传自定义策略”。Select Upload custom policy.
  6. 上传以前已更改的扩展文件。Upload the extensions file that you previously changed.

使用“立即运行”测试自定义策略Test the custom policy by using Run now

  1. 选择已上传的策略,然后选择“立即运行”。Select the policy that you uploaded, and then select Run now.
  2. 你应该能够看到已本地化的注册或登录页面。You should be able to see the localized sign-up or sign-in page.
  3. 单击注册链接,你应该能够看到已本地化的注册页面。Click on the sign-up link, and you should be able to see the localized sign-up page.
  4. 将浏览器默认语言切换为西班牙语。Switch your browser default language to Spanish. 还可以将查询字符串参数 ui_locales 添加到授权请求。Or you can add the query string parameter, ui_locales to the authorization request. 例如:For example:

其他信息Additional information

页面 UI 自定义标签保留为重写Page UI customization labels as overrides

启用语言自定义时,会在英语 (en) 的 JSON 文件中保留以前使用页面 UI 自定义的标签编辑。When you enable language customization, your previous edits for labels using page UI customization are persisted in a JSON file for English (en). 可以通过在语言自定义中上传语言资源来继续更改标签和其他字符串。You can continue to change your labels and other strings by uploading language resources in language customization.

最新的翻译Up-to-date translations

Microsoft 致力于提供最新的翻译以供使用。Microsoft is committed to providing the most up-to-date translations for your use. Microsoft 会持续改进翻译,使其符合需要。Microsoft continuously improves translations and keeps them in compliance for you. Microsoft 将识别全局术语中的 bug 和更改,并在用户流中进行无缝更新。Microsoft will identify bugs and changes in global terminology and make updates that will work seamlessly in your user flow.

对从右向左书写的语言的支持Support for right-to-left languages

Microsoft 目前不支持从右向左书写的语言。Microsoft currently doesn't provide support for right-to-left languages. 你可以通过使用自定义区域设置并使用 CSS 更改字符串的显示方式来实现此目的。You can accomplish this by using custom locales and using CSS to change the way the strings are displayed. 如果需要此功能,请在 Azure 反馈中为此功能投票。If you need this feature, please vote for it on Azure Feedback.

社交标识提供者翻译Social identity provider translations

Microsoft 为社交登录名提供 ui_locales OIDC 参数。Microsoft provides the ui_locales OIDC parameter to social logins. 但某些社交标识提供者并不遵循此参数。But some social identity providers, don't honor them.

浏览器行为Browser behavior

Chrome 和 Firefox 都会请求其设置的语言。Chrome and Firefox both request for their set language. 如果支持该语言,将先显示该语言,再显示默认语言。If it's a supported language, it's displayed before the default. Microsoft Edge 目前不会请求语言,而是直接使用默认语言。Microsoft Edge currently does not request a language and goes straight to the default language.

支持的语言Supported languages

Azure AD B2C 包括对以下语言的支持。Azure AD B2C includes support for the following languages. 用户流语言由 Azure AD B2C 提供。User flow languages are provided by Azure AD B2C. 多重身份验证 (MFA) 通知语言由 Azure AD MFA 提供。The multi-factor authentication (MFA) notification languages are provided by Azure AD MFA.

语言Language 语言代码Language code 用户流User flows MFA 通知MFA notifications
阿拉伯语Arabic arar X 指示否。 绿色的选中标记。
保加利亚语Bulgarian bgbg X 指示否。 绿色的选中标记。
BanglaBangla bnbn 绿色的选中标记。 X 指示否。
加泰罗尼亚语Catalan caca X 指示否。 绿色的选中标记。
捷克语Czech cscs 绿色的选中标记。 绿色的选中标记。
丹麦语Danish dada 绿色的选中标记。 绿色的选中标记。
德语German dede 绿色的选中标记。 绿色的选中标记。
希腊语Greek elel 绿色的选中标记。 绿色的选中标记。
英语English enen 绿色的选中标记。 绿色的选中标记。
西班牙语Spanish eses 绿色的选中标记。 绿色的选中标记。
爱沙尼亚语Estonian etet X 指示否。 绿色的选中标记。
巴斯克语Basque eueu X 指示否。 绿色的选中标记。
芬兰语Finnish fifi 绿色的选中标记。 绿色的选中标记。
法语French frfr 绿色的选中标记。 绿色的选中标记。
加利西亚语Galician glgl X 指示否。 绿色的选中标记。
古吉拉特语Gujarati gugu 绿色的选中标记。 X 指示否。
希伯来语Hebrew hehe X 指示否。 绿色的选中标记。
印地语Hindi hihi 绿色的选中标记。 绿色的选中标记。
克罗地亚语Croatian hrhr 绿色的选中标记。 绿色的选中标记。
匈牙利语Hungarian huhu 绿色的选中标记。 绿色的选中标记。
印度尼西亚语Indonesian idid X 指示否。 绿色的选中标记。
意大利语Italian itit 绿色的选中标记。 绿色的选中标记。
日语Japanese jaja 绿色的选中标记。 绿色的选中标记。
哈萨克语Kazakh kkkk X 指示否。 绿色的选中标记。
卡纳达语Kannada knkn 绿色的选中标记。 X 指示否。
韩语Korean koko 绿色的选中标记。 绿色的选中标记。
立陶宛语Lithuanian ltlt X 指示否。 绿色的选中标记。
拉脱维亚语Latvian lvlv X 指示否。 绿色的选中标记。
马拉雅拉姆语Malayalam mlml 绿色的选中标记。 X 指示否。
马拉地语Marathi mrmr 绿色的选中标记。 X 指示否。
马来语Malay msms 绿色的选中标记。 绿色的选中标记。
挪威博克马尔语Norwegian Bokmal nbnb 绿色的选中标记。 X 指示否。
荷兰语Dutch nlnl 绿色的选中标记。 绿色的选中标记。
挪威语Norwegian no X 指示否。 绿色的选中标记。
旁遮普语Punjabi papa 绿色的选中标记。 X 指示否。
波兰语Polish plpl 绿色的选中标记。 绿色的选中标记。
葡萄牙语 - 巴西Portuguese - Brazil pt-brpt-br 绿色的选中标记。 绿色的选中标记。
葡萄牙语 - 葡萄牙Portuguese - Portugal pt-ptpt-pt 绿色的选中标记。 绿色的选中标记。
罗马尼亚语Romanian roro 绿色的选中标记。 绿色的选中标记。
俄语Russian ruru 绿色的选中标记。 绿色的选中标记。
斯洛伐克语Slovak sksk 绿色的选中标记。 绿色的选中标记。
斯洛文尼亚语Slovenian slsl X 指示否。 绿色的选中标记。
塞尔维亚语 - 西里尔文Serbian - Cyrillic sr-cryl-cssr-cryl-cs X 指示否。 绿色的选中标记。
塞尔维亚语 - 拉丁语Serbian - Latin sr-latn-cssr-latn-cs X 指示否。 绿色的选中标记。
瑞典语Swedish svsv 绿色的选中标记。 绿色的选中标记。
泰米尔语Tamil tata 绿色的选中标记。 X 指示否。
泰卢固语Telugu tete 绿色的选中标记。 X 指示否。
泰语Thai thth 绿色的选中标记。 绿色的选中标记。
土耳其语Turkish trtr 绿色的选中标记。 绿色的选中标记。
乌克兰语Ukrainian ukuk X 指示否。 绿色的选中标记。
越南语Vietnamese vivi X 指示否。 绿色的选中标记。
简体中文Chinese - Simplified zh-hanszh-hans 绿色的选中标记。 绿色的选中标记。
繁体中文Chinese - Traditional zh-hantzh-hant 绿色的选中标记。 绿色的选中标记。

后续步骤Next steps

有关如何自定义应用程序用户界面的详细信息,请参阅在 Azure Active Directory B2C 中自定义应用程序的用户界面Find more information about how you can customize the user interface of your applications in Customize the user interface of your application in Azure Active Directory B2C.