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

# Lock.swiftでの国際化

> Lock.swiftでの国際化対応について説明します。

デフォルトで、**Lock v2 for iOS**は英語のテキストを表示します。テキストを別の言語で表示したい、または、アプリケーションのテキスト値を変えたい場合には、`Lock.strings`ファイルを提供して、Lockが表示するかもしれない各種のテキスト項目に使用する値を定義することができます。

言語の扱い方については、Appleのドキュメンテーションにある[国際化とローカリゼーション](https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/Introduction/Introduction.html#//apple_ref/doc/uid/10000171i-CH1-SW1)

## Lock文字列値

Lockが使用する用語の全リストについては、Lock.swiftリポジトリにある[Lock.strings](https://raw.githubusercontent.com/auth0/Lock.swift/master/Lock/Base.lproj/Lock.strings)ベースファイルを参照してください。

### 英語の代替文字列を提供する

既存の用語の一部や全部を変更したい場合には、[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/docs/images/ja-jp/cdy7uua7fh8z/2dL3QXXrURBjNjyF5R0xYG/68cf0217f351bfb5e5a0bf45a7361b03/xcode_localize.png" alt="Lock.swift: Localize" />
</Frame>

そして、［`English`（英語）］を選択します。

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/auth0/docs/images/ja-jp/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";`

### 他の言語に対応する

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

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/auth0/docs/images/ja-jp/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/docs/images/ja-jp/cdy7uua7fh8z/6E7BZaCVtkHcCQFhEcgSTq/3314eb8142c03266b25ab84fbefbb8f6/xcode_add_language_step_2.png" alt="Lock.swift: Add Language step 2" />
</Frame>

**Lock.strings**の下に、選択した**Reference Language**に基づいて、指定した言語の新しいファイルが作成されます。

これで、希望の言語に翻訳する準備が整いました。

### 注意

用語によってはパラメーターを伴うため、翻訳する際にはそれらの配置を考慮することが重要です。特に、以下のように、複数のパラメーターがある用語には注意してください。

`// 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)";`
