Azure Active Directory B2C 中的語言自定義

開始之前,請使用 [選擇原則類型 選取器] 來選擇您要設定的原則類型。 Azure Active Directory B2C 提供兩種方法來定義使用者如何與您的應用程式互動:透過預先 定義的使用者流程 ,或透過完全可設定 的自定義原則。 本文中每個方法所需的步驟都不同。

Azure Active Directory B2C (Azure AD B2C) 中的語言自定義可讓您的使用者流程適應不同的語言,以符合客戶需求。 Microsoft 提供 36 種語言翻譯,但您也可以為任何語言提供自己的翻譯。 即使您的體驗只提供單一語言,您也可以自定義頁面上的任何文字。

語言自定義的運作方式

您可以使用語言自定義來選取使用者流程可用的語言。 開啟此功能之後,您可以從應用程式提供查詢字串參數 ui_locales。 當您呼叫 Azure AD B2C 時,您的頁面會轉譯為您指示的地區設定。 這種類型的設定可讓您完全控制使用者流程中的語言,並忽略客戶瀏覽器的語言設定。

您不一定需要對客戶所看到的語言進行這種程度的控制。 如果您沒有提供 ui_locales 參數,則客戶的體驗會由其瀏覽器的設定決定。 您仍然可以將使用者流程新增為支援的語言來控制轉譯成的語言。 如果客戶的瀏覽器設定為顯示您不想支援的語言,則會改為顯示您選取為支援文化特性中預設值的語言。

  • ui 地區設定指定的語言:啟用語言自定義之後,您的使用者流程會轉譯為這裡指定的語言。
  • 瀏覽器要求的語言:如果未ui_locales指定任何參數,則如果支持語言,您的使用者流程會轉譯為瀏覽器要求的語言。
  • 原則預設語言:如果瀏覽器未指定語言,或指定不支持的語言,則會將使用者流程轉譯為使用者流程默認語言。

注意

如果您使用自定義使用者屬性,則必須提供自己的翻譯。 如需詳細資訊,請參閱 自定義您的字串

觀看這段影片,瞭解如何使用 Azure AD B2C 當地語系化或自定義語言。

當地語系化需要三個步驟:

  1. 設定支援語言的明確清單
  2. 提供特定語言的字串和集合
  3. 編輯頁面的內容定義

必要條件

支援ui_locales要求的語言

在語言自定義正式運作之前所建立的原則,必須先啟用此功能。 默認會啟用語言自定義之後所建立的原則和使用者流程。

當您在使用者流程上啟用語言自定義時,您可以藉由新增 ui_locales 參數來控制使用者流程的語言。

  1. 在您的 Azure AD B2C 租使用者中,選取 [ 使用者流程]。
  2. 按兩下您要啟用翻譯的使用者流程。
  3. 選取 [ 語言]。
  4. 選取 [ 啟用語言自定義]。

選取已啟用使用者流程中的語言

啟用一組語言,讓使用者流程在瀏覽器要求時翻譯為 ,而不需要 ui_locales 參數。

  1. 請確定您的使用者流程已從先前的指示啟用語言自定義。
  2. 在使用者流程的 [ 語言] 頁面上,選取您想要支持的語言。
  3. 在 [屬性] 窗格中,將 [已啟用] 變更[是]。
  4. 選取 屬性窗格頂端的 [儲存 ]。

注意

ui_locales如果未提供參數,頁面只會在啟用時轉譯為客戶的瀏覽器語言。

自訂您的字串

語言自定義可讓您自定義使用者流程中的任何字串。

  1. 請確定您的使用者流程已從先前的指示啟用語言自定義。
  2. 在使用者流程的 [ 語言] 頁面上,選取您想要自定義的語言。
  3. [頁面層級資源檔案] 底下,選取您要編輯的頁面。
  4. 如果您先前已編輯此語言,請選取 [ 下載預設值 ] (或 [下載覆寫 ]。

這些步驟提供 JSON 檔案,可用來開始編輯字串。

變更頁面上的任何字串

  1. 在 JSON 編輯器中開啟從先前指示下載的 JSON 檔案。
  2. 尋找您想要變更的專案。 您可以尋找 StringId 您要尋找的字串,或尋找 Value 您想要變更的屬性。
  3. 使用 Value 您想要顯示的內容來更新屬性。
  4. 針對您要變更的每個字串,請變更 Overridetrue
  5. 儲存盤案並上傳您的變更。 (您可以在下載 JSON 檔案的位置找到上傳控制件。

重要

如果您需要覆寫字串,請務必將 Override 值設定為 true。 如果未變更值,則會忽略專案。

變更擴充屬性

如果您要變更自訂使用者屬性的字串,或想要將字串新增至 JSON,其格式如下:

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

將取代 <ExtensionAttribute> 為您自定義使用者屬性的名稱。

將取代 <ExtensionAttributeValue> 為要顯示的新字串。

使用 LocalizedCollections 提供值清單

如果您想要提供回應的一組值清單,您必須建立 LocalizedCollections 屬性。 LocalizedCollections是和 Value 配對的Name陣列。 項目的順序將會是其顯示的順序。 若要新增 LocalizedCollections,請使用下列格式:

{
  "LocalizedStrings": [...],
  "LocalizedCollections": [
    {
      "ElementType":"ClaimType",
      "ElementId":"<UserAttribute>",
      "TargetCollection":"Restriction",
      "Override": true,
      "Items":[
        {
          "Name":"<Response1>",
          "Value":"<Value1>"
        },
        {
          "Name":"<Response2>",
          "Value":"<Value2>"
        }
      ]
    }
  ]
}
  • ElementId 是此屬性 LocalizedCollections 是回應的用戶屬性。
  • Name 是向用戶顯示的值。
  • Value 是選取此選項時,宣告中傳回的內容。

上傳變更

  1. 完成 JSON 檔案的變更之後,請返回 B2C 租使用者。
  2. 選取 [使用者流程 ],然後按下您想要啟用翻譯的使用者流程。
  3. 選取 [ 語言]。
  4. 選取您想要翻譯的語言。
  5. 選取您想要提供翻譯的頁面。
  6. 選取資料夾圖示,然後選取要上傳的 JSON 檔案。

變更會自動儲存至您的使用者流程。

使用語言自定義頁面 UI

有兩種方式可將 HTML 內容當地語系化。 其中一種方式是開啟 語言自定義。 啟用此功能可讓 Azure AD B2C 將 OpenID 連線 參數ui-locales轉送至您的端點。 您的內容伺服器可以使用此參數來提供特定語言的自定義 HTML 頁面。

或者,您可以根據所使用的地區設定,從不同位置提取內容。 在啟用 CORS 的端點中,您可以設定資料夾結構來裝載特定語言的內容。 如果您使用通配符值,則會呼叫正確的值 {Culture:RFC5646}。 例如,假設這是您的自定義頁面 URI:

https://wingtiptoysb2c.blob.core.windows.net/{Culture:RFC5646}/wingtip/unified.html

您可以在 中 fr載入頁面。 當頁面提取 HTML 和 CSS 內容時,它會從下列專案提取:

https://wingtiptoysb2c.blob.core.windows.net/fr/wingtip/unified.html

新增自訂語言

您也可以新增 Microsoft 目前未提供翻譯的語言。 您必須提供使用者流程中所有字串的翻譯。 語言和地區設定代碼僅限於 ISO 639-1 標準中的語言和地區設定代碼。 地區設定程式代碼格式應該是 「ISO_639-1_code」-「CountryCode」,例如 en-GB。 如需詳細資訊,請參閱 地區設定標識符格式

  1. 在您的 Azure AD B2C 租使用者中,選取 [ 使用者流程]。
  2. 按兩下您要新增自訂語言的使用者流程,然後按兩下 [ 語言]。
  3. 從頁面頂端選取 [新增自定義語言 ]。
  4. 在開啟的內容窗格中,輸入有效的地區設定程式代碼來識別您要提供翻譯的語言。
  5. 針對每個頁面,您可以下載一組英文覆寫,並處理翻譯。
  6. 使用 JSON 檔案完成之後,您可以針對每個頁面上傳它們。
  7. 選取 [ 啟用],您的使用者流程現在可以為您的用戶顯示此語言。
  8. 儲存語言。

重要

您必須啟用自定義語言或上傳覆寫,才能儲存。

設定支援的語言清單

開啟原則的延伸模組檔案。 例如: SocialAndLocalAccounts/TrustFrameworkExtensions.xml

  1. 搜尋 BuildingBlocks 元素。 如果專案不存在,請加以新增。
  2. Localization使用支援的語言新增 元素:英文(預設值)和西班牙文。
<Localization Enabled="true">
  <SupportedLanguages DefaultLanguage="en" MergeBehavior="ReplaceAll">
    <SupportedLanguage>en</SupportedLanguage>
    <SupportedLanguage>es</SupportedLanguage>
  </SupportedLanguages>
</Localization>

提供特定語言的標籤

專案的 LocalizedResourcesLocalization 包含當地語系化字串的清單。 本地化的資源專案具有用來唯一識別本地化資源的標識碼。 此標識碼稍後會在 內容定義 專案中使用。

您可以設定內容定義的當地語系化資源元素,以及您想要支援的任何語言。 若要自定義英文和西班牙文的統一註冊或登入頁面,請在元素關閉</SupportedLanguages>之後新增下列LocalizedResources元素。

注意

在下列範例中,我們在每一行開頭新增了磅 # 符號,讓您可以輕鬆地在畫面上尋找本地化的標籤。

<!--Local account sign-up or sign-in page English-->
<Localization Enabled="true">
  ...
 <LocalizedResources Id="api.signuporsignin.en">
        <LocalizedStrings>
          <LocalizedString ElementType="ClaimType" ElementId="signInName" StringId="DisplayName">Email Address</LocalizedString>
          <LocalizedString ElementType="UxElement" StringId="heading">Sign in</LocalizedString>
          <LocalizedString ElementType="UxElement" StringId="social_intro">Sign in with your social account</LocalizedString>
          <LocalizedString ElementType="UxElement" StringId="local_intro_generic">Sign in with your {0}</LocalizedString>
          <LocalizedString ElementType="ClaimType" ElementId="password" StringId="DisplayName">Password</LocalizedString>
          <LocalizedString ElementType="UxElement" StringId="requiredField_password">Please enter your password</LocalizedString>
          <LocalizedString ElementType="UxElement" StringId="requiredField_generic">Please enter your {0}</LocalizedString>
          <LocalizedString ElementType="UxElement" StringId="invalid_generic">Please enter a valid {0}</LocalizedString>
          <LocalizedString ElementType="UxElement" StringId="createaccount_one_link">Sign up now</LocalizedString>
          <LocalizedString ElementType="UxElement" StringId="createaccount_two_links">Sign up with {0} or {1}</LocalizedString>
          <LocalizedString ElementType="UxElement" StringId="createaccount_three_links">Sign up with {0}, {1}, or {2}</LocalizedString>
          <LocalizedString ElementType="UxElement" StringId="forgotpassword_link">Forgot your password?</LocalizedString>
          <LocalizedString ElementType="UxElement" StringId="button_signin">Sign in</LocalizedString>
          <LocalizedString ElementType="UxElement" StringId="divider_title">OR</LocalizedString>
          <LocalizedString ElementType="UxElement" StringId="createaccount_intro">Don't have an account?</LocalizedString>
          <LocalizedString ElementType="UxElement" StringId="unknown_error">We are having trouble signing you in. Please try again later.</LocalizedString>
          <!-- Uncomment the remember_me only if the keep me signed in is activated. 
          <LocalizedString ElementType="UxElement" StringId="remember_me">Keep me signed in</LocalizedString> -->
          <LocalizedString ElementType="ClaimsProvider" StringId="FacebookExchange">Facebook</LocalizedString>
          <LocalizedString ElementType="ErrorMessage" StringId="ResourceOwnerFlowInvalidCredentials">Your password is incorrect.</LocalizedString>
          <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfInvalidPassword">Your password is incorrect.</LocalizedString>
          <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfPasswordExpired">Your password has expired.</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>
        </LocalizedStrings>
      </LocalizedResources>
  <!--Local account sign-up or sign-in page Spanish-->
  <LocalizedResources Id="api.signuporsignin.es">
    <LocalizedStrings>
      <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>
    </LocalizedStrings>
  </LocalizedResources>
  <!--Local account sign-up page English-->
  <LocalizedResources Id="api.localaccountsignup.en">
    <LocalizedStrings>
      <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>
    </LocalizedStrings>
  </LocalizedResources>
  <!--Local account sign-up page Spanish-->
  <LocalizedResources Id="api.localaccountsignup.es">
    <LocalizedStrings>
      <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>
    </LocalizedStrings>
  </LocalizedResources>
</Localization>

使用當地語系化編輯內容定義

貼上您複製為 BuildingBlocks 元素子系之 ContentDefinitions 元素的整個內容。

在下列範例中,英文 (en) 和西班牙文 (es) 自定義字串會新增至註冊或登入頁面,以及本機帳戶註冊頁面。 每個 LocalizedResourcesReference 的 LocalizedResourcesReferenceId 與其地區設定相同,但您可以使用任何字串作為標識符。 針對每個語言和頁面組合,您會指向您先前建立的對應 LocalizedResources

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

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

上傳及測試已更新的自定義原則

上傳自定義原則

  1. 儲存延伸模組檔案。
  2. 如果您有多個租使用者的存取權,請選取頂端功能表中的 設定 圖示,從 [目錄 + 訂用帳戶] 功能表切換至您的 Azure AD B2C 租使用者。
  3. 搜尋並選取 Azure AD B2C
  4. 在 [原則] 底下,選取 [身分識別體驗架構]。
  5. 選取 [ 上傳自定義原則]。
  6. 上傳您先前變更的擴展名檔案。

使用 [立即執行] 測試自定義原則

  1. 選取您上傳的原則,然後選取 [ 立即執行]。
  2. 您應該可以看到本地化的註冊或登入頁面。
  3. 按兩下註冊連結,您應該可以看到本地化的註冊頁面。
  4. 將您的瀏覽器預設語言切換為西班牙文。 或者,您可以將查詢字串參數 ui_locales 新增至授權要求。 例如:
https://<tenant-name>.b2clogin.com/<tenant-name>.onmicrosoft.com/B2C_1A_signup_signin/oauth2/v2.0/authorize&client_id=0239a9cc-309c-4d41-12f1-31299feb2e82&nonce=defaultNonce&redirect_uri=https%3A%2F%2Fjwt.ms&scope=openid&response_type=id_token&prompt=login&ui_locales=es

其他資訊

頁面 UI 自定義標籤做為覆寫

當您啟用語言自定義時,先前使用頁面 UI 自定義的標籤編輯會保存在英文的 JSON 檔案中(en)。 您可以上傳語言自定義中的語言資源,以繼續變更標籤和其他字串。

最新翻譯

Microsoft 致力於提供最新的翻譯以供您使用。 Microsoft 會持續改善翻譯,並符合您的規範。 Microsoft 會識別全域術語中的 Bug 和變更,並進行將在使用者流程中順暢運作的更新。

支援由右至左的語言

Microsoft 目前不支援由右至左的語言。 您可以使用自定義地區設定,並使用 CSS 來變更字串的顯示方式來完成此作業。 如果您需要此功能,請在 Azure 意見反應投票給此功能。

社交識別提供者翻譯

Microsoft 提供社交登入的 ui_locales OIDC 參數。 但一些社交身份提供者,包括Facebook和谷歌,不尊重他們。

瀏覽器行為

Chrome 和 Firefox 都要求其設定語言。 如果是支持的語言,則會在預設值之前顯示。 Microsoft Edge 目前不會要求語言,並直接移至默認語言。

支援的語言

Azure AD B2C 包含下列語言的支援,方法是使用 ISO 639-1 代碼。 使用者流程語言是由 Azure AD B2C 提供。 多重要素驗證通知語言是由 Microsoft Entra 多重要素驗證所提供。

語言 語言代碼 使用者流程 MFA 通知
阿拉伯文 ar X indicating no. Green check mark.
保加利亞文 bg X indicating no. Green check mark.
孟加拉文 Green check mark. X indicating no.
加泰蘭文 ca X indicating no. Green check mark.
捷克文 cs Green check mark. Green check mark.
丹麥文 da Green check mark. Green check mark.
德文 de Green check mark. Green check mark.
希臘文 el Green check mark. Green check mark.
英語 en Green check mark. Green check mark.
西班牙文 es Green check mark. Green check mark.
愛沙尼亞文 et X indicating no. Green check mark.
巴斯克文 eu X indicating no. Green check mark.
芬蘭文 fi Green check mark. Green check mark.
法文 fr Green check mark. Green check mark.
加利西亞文 gl X indicating no. Green check mark.
古吉拉特文 Green check mark. X indicating no.
希伯來文 he X indicating no. Green check mark.
印度文 hi Green check mark. Green check mark.
克羅埃西亞文 小時 Green check mark. Green check mark.
匈牙利文 hu Green check mark. Green check mark.
印尼文 識別碼 X indicating no. Green check mark.
義大利文 it Green check mark. Green check mark.
日文 ja Green check mark. Green check mark.
哈薩克文 kk X indicating no. Green check mark.
坎那達文 kn Green check mark. X indicating no.
韓文 ko Green check mark. Green check mark.
立陶宛文 lt X indicating no. Green check mark.
拉脫維亞文 lv X indicating no. Green check mark.
馬來亞拉姆文 ml Green check mark. X indicating no.
馬拉地文 先生 Green check mark. X indicating no.
馬來文 毫秒 Green check mark. Green check mark.
挪威文博克瑪律文 nb Green check mark. X indicating no.
荷蘭文 nl Green check mark. Green check mark.
挪威文 X indicating no. Green check mark.
旁遮普文 Pa Green check mark. X indicating no.
波蘭文 pl Green check mark. Green check mark.
葡萄牙文 - 巴西 pt-br Green check mark. Green check mark.
葡萄牙文 - 葡萄牙 pt-pt Green check mark. Green check mark.
羅馬尼亞文 ro Green check mark. Green check mark.
俄文 ru Green check mark. Green check mark.
斯洛伐克文 sk Green check mark. Green check mark.
斯洛維尼亞文 sl X indicating no. Green check mark.
塞爾維亞文 (斯拉夫) sr-cryl-cs X indicating no. Green check mark.
塞爾維亞文 (拉丁) sr-latn-cs X indicating no. Green check mark.
瑞典文 sv Green check mark. Green check mark.
坦米爾文 ta Green check mark. X indicating no.
泰盧固文 te Green check mark. X indicating no.
泰文 th Green check mark. Green check mark.
土耳其文 tr Green check mark. Green check mark.
烏克蘭文 uk X indicating no. Green check mark.
越南文 vi X indicating no. Green check mark.
威爾斯文 cy X indicating no. X indicating no.
簡體中文 zh-hans Green check mark. Green check mark.
繁體中文 zh-hant Green check mark. Green check mark.

下一步

在 Azure Active Directory B2C 中自定義應用程式的使用者介面中,尋找如何自定義應用程式使用者介面的詳細資訊。