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

# パッケージ リソースのローカライズ

> MicrosoftGame.config、チャンク レイアウト、およびロケール別ダウンロードのための Intelligent Delivery を使用して、GDK パッケージ内の文字列、画像、アセットをローカライズします。

`MicrosoftGame.config` で参照される文字列と画像は、ユーザーのロケールに合わせてローカライズできます。Visual Studio 2019+ は、実行時に OS が参照する `resources.pri` ファイルを自動生成します。

GDK コマンド プロンプトからこのファイルをダンプできます。

```text theme={null}
MakePri.exe dump /if resources.pri /of out.xml
```

## アプリ名と説明のローカライズ

### 既定の文字列を追加する

1. ソリューション エクスプローラーでプロジェクトを右クリックし、`Strings` という **新しいフィルター** を追加します。
2. `Strings` を右クリックして **新しい項目 > アセンブリ リソース ファイル (.resx)** を追加します。VS がパッケージのルートに `resources.resx` を作成します。

<Note>
  GDK では `.resw` が必要です。`resources.resx` の名前を `resources.resw` に変更してください。
</Note>

### MicrosoftGame.config から文字列を参照する

```xml theme={null}
<ShellVisuals DefaultDisplayName="ms-resource:AppName"
              PublisherDisplayName="Publisher Display name"
              StoreLogo="StoreLogo.png"
              Square150x150Logo="Logo.png"
              Square44x44Logo="SmallLogo.png"
              Description="ms-resource:AppDescription"
              BackgroundColor="#000040"
              SplashScreenImage="SplashScreen.png"/>
```

### 言語ごとの文字列を追加する

サポートする言語ごとに `Strings/<lang>` フィルターを作成し、それぞれの下にアセンブリ リソース ファイルを追加します。**項目の種類** を **PRI Resource** に設定し、拡張子を `.resw` に変更します。

### MicrosoftGame.config で言語を宣言する

```xml theme={null}
<Resources>
    <Resource Language="en-US"/>
    <Resource Language="fr-FR"/>
    <Resource Language="de-DE"/>
</Resources>
```

繁体字中国語をサポートする場合、フォールバック用に `zh-SG` と `zh-CN` も列挙します。

## ローカライズ可能な画像を追加する

`Logo`、`SmallLogo`、`SplashScreen`、`StoreLogo` はローカライズ可能です。

1. 共有フォルダー (例: `Images`) の下に、言語ごとのサブフォルダーを追加します。
2. **項目の種類** = **Image**、**Content** = **Yes** で画像を追加します。
3. フォールバックとして、ルートに既定の画像を用意します。

<Note>
  少なくとも 1 つの画像リソースを含めてください。そうでない場合、ローカライズ済みの文字列が解決されず、タイトル名が `ms-resource:AppName` と表示されてしまいます。
</Note>

## チャンク レイアウト

```xml theme={null}
<Chunk Id="1000" Marker="Launch">
    <FileGroup DestinationPath="\Images"       SourcePath="Images"       Include="*.*"/>
    <FileGroup DestinationPath="\Images\en-US" SourcePath="Images\en-US" Include="*.*"/>
    <FileGroup DestinationPath="\Images\fr-FR" SourcePath="Images\fr-FR" Include="*.*"/>
    <FileGroup DestinationPath="\" SourcePath="." Include="resources.pri"/>
</Chunk>
```

## Intelligent Delivery

チャンクに `Languages` タグを付けます。

```xml theme={null}
<Chunk Id="1005" Languages="en-US">
    <FileGroup DestinationPath="\assets\audio" SourcePath="." Include="en_us_commentary.mp3"/>
</Chunk>
<Chunk Id="1008" Languages="es-MX, en-US">
    <FileGroup DestinationPath="\assets" SourcePath="." Include="mixed_content.dat"/>
</Chunk>
```

### インストール動作

* コンソールが `en-US` → 1005 と 1008 をインストールします。
* コンソールが `en-GB` → `en-US` にフォールバックし、1005 と 1008 をインストールします。
* タグの付いていないチャンクは常にインストールされます。

### xbapp によるテスト

* `/Languages` — コンソールの設定に関係なく、指定した言語に対してインストールします。
* `/AllChunks` — パッケージ全体をインストールします。
* `/w` — インストール後も接続を維持します。

## 関連項目

* [MicrosoftGame.config のローカライズ](/build/core-features/common/game-config/MicrosoftGameConfig-Localization)
* [Intelligent Delivery](/build/core-features/common/packaging/intelligentdelivery-features-recipes)

## 関連 API ドキュメント

* [XPackage API リファレンス](/reference/system/xpackage/xpackage_members) — ローカライズされたパッケージ チャンクのマウント／列挙
* [MicrosoftGame.config elements リファレンス](/reference/system/microsoftgameconfig/elements/gc-microsoftgameconfig-toc) — リソース + チャンクの宣言


## Related topics

- [サポートされている言語](/ja-jp/publishing/game-publishing/concepts/metadata-supported-languages.md)
- [ローカライズとグローバライゼーションの概要](/ja-jp/build/game-principles/localization.md)
- [MicrosoftGame.config のローカライズ](/ja-jp/build/core-features/common/game-config/MicrosoftGameConfig-Localization.md)
- [コンソールのロケールと言語の判定](/ja-jp/build/game-principles/localization/determining-console-locale.md)
- [ゲームでサポート／未サポートのロケール](/ja-jp/build/game-principles/localization/game-supported-and-unsupported-locales.md)
