> ## Documentation Index
> Fetch the complete documentation index at: https://translations.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ログインページのローカライズ時に選択できる言語について説明します。

# Universal Login の多言語対応

export const AuthCodeGroup = ({children, dropdown}) => {
  const [processedChildren, setProcessedChildren] = useState(children);
  useEffect(() => {
    let unsubscribe = null;
    function init() {
      unsubscribe = window.autorun(() => {
        const processChildren = node => {
          if (typeof node === "string") {
            let processedNode = node;
            for (const [key, value] of window.rootStore.variableStore.values.entries()) {
              const escapedKey = key.replaceAll(/[.*+?^${}()|[\]\\]/g, (String.raw)`\$&`);
              processedNode = processedNode.replaceAll(new RegExp(escapedKey, "g"), value);
            }
            return processedNode;
          } else if (Array.isArray(node)) {
            return node.map(processChildren);
          } else if (node && node.props && node.props.children) {
            return {
              ...node,
              props: {
                ...node.props,
                children: processChildren(node.props.children)
              }
            };
          }
          return node;
        };
        setProcessedChildren(processChildren(children));
      });
    }
    if (window.rootStore) {
      init();
    } else {
      window.addEventListener("adu:storeReady", init);
    }
    return () => {
      window.removeEventListener("adu:storeReady", init);
      unsubscribe?.();
    };
  }, [children]);
  return <CodeGroup dropdown={dropdown}>{processedChildren}</CodeGroup>;
};

export const AuthCodeBlock = ({filename, icon, language, highlight, children}) => {
  const [displayText, setDisplayText] = useState(children);
  const [copyText, setCopyText] = useState(children);
  const wrapperRef = React.useRef(null);
  useEffect(() => {
    let unsubscribe = null;
    function init() {
      if (!window.autorun || !window.rootStore) {
        return;
      }
      unsubscribe = window.autorun(() => {
        let processedChildrenForDisplay = children;
        let processedChildrenForCopy = children;
        for (const [key, value] of window.rootStore.variableStore.values.entries()) {
          const escapedKey = key.replaceAll(/[.*+?^${}()|[\]\\]/g, (String.raw)`\$&`);
          let displayValue = value;
          if (key === "{yourClientSecret}" && value !== "{yourClientSecret}") {
            displayValue = value.substring(0, 3) + "*****マスク済み*****";
          }
          processedChildrenForDisplay = processedChildrenForDisplay.replaceAll(new RegExp(escapedKey, "g"), displayValue);
          processedChildrenForCopy = processedChildrenForCopy.replaceAll(new RegExp(escapedKey, "g"), value);
        }
        setDisplayText(processedChildrenForDisplay);
        setCopyText(processedChildrenForCopy);
      });
    }
    if (window.rootStore) {
      init();
    } else {
      window.addEventListener("adu:storeReady", init);
    }
    return () => {
      window.removeEventListener("adu:storeReady", init);
      unsubscribe?.();
    };
  }, [children]);
  useEffect(() => {
    if (!wrapperRef.current) return;
    const originalWriteText = navigator.clipboard.writeText.bind(navigator.clipboard);
    let isOverriding = false;
    const handleClick = e => {
      const button = e.target.closest('[data-testid="copy-code-button"]');
      if (!button || !wrapperRef.current.contains(button)) return;
      isOverriding = true;
      navigator.clipboard.writeText = text => {
        if (isOverriding) {
          isOverriding = false;
          navigator.clipboard.writeText = originalWriteText;
          return originalWriteText(copyText);
        }
        return originalWriteText(text);
      };
      setTimeout(() => {
        if (isOverriding) {
          isOverriding = false;
          navigator.clipboard.writeText = originalWriteText;
        }
      }, 100);
    };
    const wrapper = wrapperRef.current;
    wrapper.addEventListener('click', handleClick, true);
    return () => {
      wrapper.removeEventListener('click', handleClick, true);
      if (navigator.clipboard.writeText !== originalWriteText) {
        navigator.clipboard.writeText = originalWriteText;
      }
    };
  }, [copyText]);
  return <div ref={wrapperRef}>
      <CodeBlock filename={filename} icon={icon} language={language} lines highlight={highlight}>
        {displayText}
      </CodeBlock>
    </div>;
};

<div id="universal-login-localization">
  ## Universal Login のローカライズ
</div>

<Tooltip tip="Universal Login: アプリケーションは、ユーザーの本人確認を行うために、Auth0 の認可サーバーでホストされる Universal Login にリダイレクトされます。" cta="用語集を見る" href="/ja/docs/glossary?term=Universal+Login">Universal Login</Tooltip> は、以下の言語にローカライズされています。アスタリスクが付いた項目は右から左に表記されます。

| 言語                 | コード      |
| ------------------ | -------- |
| アルバニア語             | `sq`     |
| アムハラ語              | `am`     |
| アラビア語\*            | `ar`     |
| アラビア語 (エジプト) \*    | `ar-EG`  |
| アラビア語 (サウジアラビア) \* | `ar-SA`  |
| アルメニア語             | `hy`     |
| アゼルバイジャン語          | `az`     |
| バスク語               | `eu-ES`  |
| ベンガル語              | `bn`     |
| ボスニア語              | `bs`     |
| ブルガリア語             | `bg`     |
| カタルーニャ語            | `ca-ES`  |
| 中国語 - 香港           | `zh-HK`  |
| 中国語 - 簡体字          | `zh-CN`  |
| 中国語 - 繁体字          | `zh-TW`  |
| クロアチア語             | `hr`     |
| チェコ語               | `cs`     |
| デンマーク語             | `da`     |
| オランダ語              | `nl`     |
| 英語                 | `en`     |
| 英語 - カナダ           | `en-CA`  |
| エストニア語             | `et`     |
| ペルシア語 (ファルシ) \*    | `fa`     |
| フィンランド語            | `fi`     |
| フランス語              | `fr-FR`  |
| フランス語 - カナダ        | `fr-CA`  |
| ガリシア語              | `gl-ES`  |
| ジョージア語             | `ka`     |
| ドイツ語               | `de`     |
| ギリシャ語              | `el`     |
| グジャラート語            | `gu`     |
| ヘブライ語\*            | `he`     |
| ヒンディー語             | `hi`     |
| ハンガリー語             | `hu`     |
| アイスランド語            | `is`     |
| インドネシア語            | `id`     |
| イタリア語              | `it`     |
| 日本語                | `ja`     |
| カンナダ語              | `kn`     |
| 韓国語                | `ko`     |
| ラトビア語              | `lv`     |
| リトアニア語             | `lt`     |
| マケドニア語             | `mk`     |
| マレー語               | `ms`     |
| マラヤーラム語            | `ml`     |
| マラーティー語            | `mr`     |
| モンゴル語              | `mn`     |
| モンテネグロ語            | `cnr`    |
| ミャンマー語             | `my`     |
| ノルウェー語             | `no`     |
| ノルウェー語 - ブークモール    | `nb`     |
| ノルウェー語 - ニーノシュク    | `nn`     |
| ポーランド語             | `pl`     |
| ポルトガル語 - ブラジル      | `pt-BR`  |
| ポルトガル語 - ポルトガル     | `pt-PT`  |
| パンジャブ語             | `pa`     |
| ルーマニア語             | `ro`     |
| ロシア語               | `ru`     |
| セルビア語              | `sr`     |
| スロバキア語             | `sk`     |
| スロベニア語             | `sl`     |
| ソマリ語               | `so`     |
| スペイン語              | `es`     |
| スペイン語 - アルゼンチン     | `es-AR`  |
| スペイン語 - ラテンアメリカ    | `es-419` |
| スペイン語 - メキシコ       | `es-MX`  |
| スワヒリ語              | `sw`     |
| スウェーデン語            | `sv`     |
| タガログ語              | `tl`     |
| タマジット語             | `zgh`    |
| タミル語               | `ta`     |
| テルグ語               | `te`     |
| タイ語                | `th`     |
| トルコ語               | `tr`     |
| ウクライナ語             | `uk`     |
| ウルドゥー語\*           | `ur`     |
| ベトナム語              | `vi`     |
| ウェールズ語             | `cy`     |

<div id="language-selection">
  ### 言語の選択
</div>

Auth0 は、次の内容に基づいてページの表示言語を決定します。

* 上記に記載されている、Auth0 でサポートされている言語
* Auth0 Dashboard の [**Tenant Settings**](https://manage.auth0.com/#/tenant) セクションで設定された言語の一覧。このセクションでは、テナントでサポートする言語を選択し、既定の言語を 1 つ設定できます。デフォルトでは英語のみが選択されていますが、必要に応じて追加できます。
* [Authorization Request endpoint](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest) に送信される `ui_locales` パラメーターの値。このパラメーターを使用すると、アプリケーションまたはセッションで使用する言語の一覧を制限できます。スペース区切りでロケールの一覧を指定できます。UI に反映するには、一覧の先頭のロケールがテナントで有効になっているロケールと一致している必要があります。
* ブラウザーから送信される `Accept-Language` HTTP ヘッダー。この言語が上記の設定で許可されている場合、Auth0 はその言語でページを表示します。許可されていない場合は、既定の言語で表示されます。

追加する言語コードに合わせて `he` を置き換え、次の本文を指定して [Tenants endpoint](https://auth0.com/docs/api/management/v2/tenants/patch-settings) に `PATCH` リクエストを送信するには、Auth0 <Tooltip tip="Management API: 顧客が管理タスクを実行できるようにする製品です。" cta="用語集を見る" href="/ja/docs/glossary?term=Management+API">Management API</Tooltip> を使用します。

```json lines theme={null}
{
  "enabled_locales": [
    "en","he"
  ]
}
```

追加したら、ログインリクエストの`ui_locales`クエリパラメーターで言語を指定します。

また、Management API の [Update Tenants endpoint](https://auth0.com/docs/api/management/v2#!/Tenants/patch_settings) を使用して、テナントで有効にする言語を指定することもできます。デフォルト言語は、リストの先頭の言語です。

<AuthCodeGroup>
  ```bash cURL theme={null}
  curl --request PATCH \
    --url 'https://{yourDomain}/api/v2/tenants/settings' \
    --header 'authorization: Bearer API2_ACCESS_TOKEN' \
    --header 'content-type: application/json' \
    --data '{ "enabled_locales" : [ "en", "es"]}'
  ```

  ```csharp C# theme={null}
  var client = new RestClient("https://{yourDomain}/api/v2/tenants/settings");
  var request = new RestRequest(Method.PATCH);
  request.AddHeader("content-type", "application/json");
  request.AddHeader("authorization", "Bearer API2_ACCESS_TOKEN");
  request.AddParameter("application/json", "{ "enabled_locales" : [ "en", "es"]}", ParameterType.RequestBody);
  IRestResponse response = client.Execute(request);
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"strings"
  	"net/http"
  	"io/ioutil"
  )

  func main() {

  	url := "https://{yourDomain}/api/v2/tenants/settings"

  	payload := strings.NewReader("{ "enabled_locales" : [ "en", "es"]}")

  	req, _ := http.NewRequest("PATCH", url, payload)

  	req.Header.Add("content-type", "application/json")
  	req.Header.Add("authorization", "Bearer API2_ACCESS_TOKEN")

  	res, _ := http.DefaultClient.Do(req)

  	defer res.Body.Close()
  	body, _ := ioutil.ReadAll(res.Body)

  	fmt.Println(res)
  	fmt.Println(string(body))

  }
  ```

  ```java Java theme={null}
  HttpResponse<String> response = Unirest.patch("https://{yourDomain}/api/v2/tenants/settings")
    .header("content-type", "application/json")
    .header("authorization", "Bearer API2_ACCESS_TOKEN")
    .body("{ "enabled_locales" : [ "en", "es"]}")
    .asString();
  ```

  ```javascript Node.JS theme={null}
  var axios = require("axios").default;

  var options = {
    method: 'PATCH',
    url: 'https://{yourDomain}/api/v2/tenants/settings',
    headers: {'content-type': 'application/json', authorization: 'Bearer API2_ACCESS_TOKEN'},
    data: {enabled_locales: ['en', 'es']}
  };

  axios.request(options).then(function (response) {
    console.log(response.data);
  }).catch(function (error) {
    console.error(error);
  });
  ```

  ```php PHP theme={null}
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://{yourDomain}/api/v2/tenants/settings",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "PATCH",
    CURLOPT_POSTFIELDS => "{ "enabled_locales" : [ "en", "es"]}",
    CURLOPT_HTTPHEADER => [
      "authorization: Bearer API2_ACCESS_TOKEN",
      "content-type: application/json"
    ],
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  ```

  ```python Python theme={null}
  import http.client

  conn = http.client.HTTPSConnection("")

  payload = "{ "enabled_locales" : [ "en", "es"]}"

  headers = {
      'content-type': "application/json",
      'authorization': "Bearer API2_ACCESS_TOKEN"
      }

  conn.request("PATCH", "/{yourDomain}/api/v2/tenants/settings", payload, headers)

  res = conn.getresponse()
  data = res.read()

  print(data.decode("utf-8"))
  ```

  ```ruby Ruby theme={null}
  require 'uri'
  require 'net/http'
  require 'openssl'

  url = URI("https://{yourDomain}/api/v2/tenants/settings")

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE

  request = Net::HTTP::Patch.new(url)
  request["content-type"] = 'application/json'
  request["authorization"] = 'Bearer API2_ACCESS_TOKEN'
  request.body = "{ "enabled_locales" : [ "en", "es"]}"

  response = http.request(request)
  puts response.read_body
  ```
</AuthCodeGroup>

<div id="right-to-left-languages">
  ### 右から左に記述する言語
</div>

<Warning>
  右から左に記述する言語のサポートは Early Access で提供されています。この機能の利用を希望する場合は、[Auth0 Support にお問い合わせください](https://support.auth0.com/)。この機能を使用すると、Okta の [Master Subscription Agreement](https://www.okta.com/legal/) に記載されている該当の Free Trial 条項に同意したものとみなされます。Auth0 の製品リリース サイクルの詳細については、[製品リリース ステージ](/ja/docs/troubleshoot/product-lifecycle/product-release-stages)を参照してください。
</Warning>

右から左に記述する言語 (RtL) のサポートを使用すると、テナントでアラビア語 (標準、エジプト、サウジアラビア) 、ペルシア語、ヘブライ語、ウルドゥー語のテキストを表示できます。RtL テキストを使用するテナントは、[WCAG 2.2 AA に準拠](/ja/docs/authenticate/login/auth0-universal-login#accessibility)している必要があります。また、テナントでページ テンプレートを使用している場合は、`dir` 属性を含めるように HTML タグを更新する必要があります。

```liquid lines theme={null}
{% assign resolved_dir = dir | default: "auto" %}
<html lang="{{locale}}" dir="{{resolved_dir}}">
```

<div id="limitations">
  ### 制限事項
</div>

* `ui_locales` パラメーターは <Tooltip tip="OAuth 2.0: 認可プロトコルとワークフローを定義する認可フレームワーク。" cta="用語集を表示" href="/ja/docs/glossary?term=OAuth">OAuth</Tooltip> フローでのみ使用できます。Security Assertion Markup Language <Tooltip tip="OAuth 2.0: 認可プロトコルとワークフローを定義する認可フレームワーク。" cta="用語集を表示" href="/ja/docs/glossary?term=SAML">(SAML)</Tooltip> または WS-Federation では使用できません。
* `ui_locales` パラメーターは、アップストリームのIDプロバイダー <Tooltip tip="IDプロバイダー（IdP）: デジタルアイデンティティを保存および管理するサービス。" cta="用語集を表示" href="/ja/docs/glossary?term=IdPs">IdPs</Tooltip> に転送されません。IdP にパラメーターを渡す方法の詳細については、[Pass Parameters to Identity Providers](/ja/docs/authenticate/identity-providers/pass-parameters-to-idps) を参照してください。
* Consent ページのスコープはローカライズできません。

<div id="known-issues">
  ### 既知の問題
</div>

* Universal Login Page では、言語コード `fr-FR` の HTML `lang` 属性が `fr` としてレンダリングされます。
* Universal Login Page では、言語コード `pt-PT` の HTML `lang` 属性が `pt` としてレンダリングされます。

<div id="classic-login-localization">
  ## クラシックログインのローカライズ
</div>

クラシックログインでは、[ログイン](/ja/docs/customize/internationalization-and-localization/lock-internationalization)、[パスワードリセットページ](/ja/docs/customize/login-pages/classic-login/customize-password-reset-page)、および [パスワードポリシー](/ja/docs/customize/internationalization-and-localization/password-options-translation) のローカライズに、Auth0 の JavaScript ウィジェットを使用します。

[多要素認証 (MFA) ページ](/ja/docs/secure/multi-factor-authentication/customize-mfa/customize-mfa-classic-login) では、デフォルトで Auth0 の <Tooltip tip="MFA（多要素認証）: SMS で送信される code など、username と password に加えて別の要素を使用するユーザー認証プロセス。" cta="用語集を表示" href="/ja/docs/glossary?term=MFA">MFA</Tooltip> ウィジェットが使用されますが、これはローカライズできません。[guardian.js](https://github.com/auth0/auth0-guardian.js) を使用すると、ローカライズ版を作成できます。

[Consent](/ja/docs/customize/login-pages/customize-consent-prompts) ページはローカライズできません。

<div id="learn-more">
  ## 詳細
</div>

* [Universal Login ページテンプレートをカスタマイズする](/ja/docs/customize/login-pages/universal-login/customize-templates)
* [Lock または SDK を使用して クラシックログイン ページをカスタマイズする](/ja/docs/customize/login-pages/classic-login/customize-with-lock-sdk)
