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

> Auth0 を使用して、iOS向け Lock をアプリケーションに国際化対応させます。

# Lock.swift の国際化

デフォルトでは、[**iOS向け Lock v2**](/docs/ja-jp/libraries/lock-swift) のテキストはすべて英語で表示されます。別の言語で表示したい場合や、アプリケーション用に文言を変更したい場合は、`Lock.strings` ファイルを用意し、Lock が表示する各種テキスト項目に使用する値を定義できます。

言語の扱い方について詳しくは、Apple の公式ドキュメント [Internationalization and Localization](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/Introduction/Introduction.html) を参照してください。

<h2 id="lock-string-values">
  Lock の文字列
</h2>

Lock で使用される用語の一覧については、Lock.swift リポジトリ内の基本の [Lock.strings](https://raw.githubusercontent.com/auth0/Lock.swift/master/Lock/Base.lproj/Lock.strings) ファイルを参照してください。

<h3 id="providing-alternative-english-strings">
  英語の代替文字列を設定する
</h3>

既存の文言の一部またはすべてを変更したい場合は、[Lock.strings](https://raw.githubusercontent.com/auth0/Lock.swift/master/Lock/Base.lproj/Lock.strings) ファイルをダウンロードしてプロジェクトに追加することで対応できます。

**Lock.strings** ファイルを選択し、`File inspector` で `Localize...` をクリックします。

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/auth0-feat-init-gt-translations/docs/images/cdy7uua7fh8z/2dL3QXXrURBjNjyF5R0xYG/68cf0217f351bfb5e5a0bf45a7361b03/xcode_localize.png" alt="Lock.swift: Localize" />
</Frame>

次に、`English` を選択します。

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/auth0-feat-init-gt-translations/docs/images/cdy7uua7fh8z/2dffBsE133pnk0Y7Y0nxHU/8b82700bbd844d5df0864287b7a0acdf/xcode_localize_english.png" alt="Lock.swift: Localize English" />
</Frame>

では、**Lock.strings** 内のいくつかの文言を別のテキストに変更してみましょう。

`// Forgot password
"com.auth0.lock.database.button.forgot_password" = "Did you forget your password?";
// tos & privacy
"com.auth0.lock.database.button.tos" = "Signing up is an indication of your agreement to our terms of\n service and privacy policy";`

<h3 id="supporting-other-languages">
  他言語への対応
</h3>

別の言語を追加するには、まず `Project/Info` で新しい言語を追加する必要があります。

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/auth0-feat-init-gt-translations/docs/images/cdy7uua7fh8z/3mHt6UmbEq7Xl05OZqtF70/20055f0037971f7b8c921d5902559b93/xcode_add_language.png" alt="Lock.swift: Add language" />
</Frame>

新しい言語を追加し、**Lock.strings** が選択されていることを確認します。

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/auth0-feat-init-gt-translations/docs/images/cdy7uua7fh8z/6E7BZaCVtkHcCQFhEcgSTq/3314eb8142c03266b25ab84fbefbb8f6/xcode_add_language_step_2.png" alt="Lock.swift: Add Language step 2" />
</Frame>

すると、**Lock.strings** の下に、**Reference Language** の設定に基づいて、指定した言語用の新しいファイルが作成されていることがわかります。

これで、目的の言語への翻訳を始める準備が整いました。

<h3 id="notes">
  注意
</h3>

一部の用語ではパラメータが使用されており、翻訳時にはその位置に注意することが重要です。特に、次のように複数のパラメータを含む用語には注意してください。

`// No more than %@{count} identical characters in a row (such as, \"%@{identical sample}\" not allowed)
"com.auth0.lock.error.password.no_more_identical" = "No more than %1$d identical characters in a row (such as, \"%2$@\" not allowed)";`
