Language specifiers declare which language the content in a chunk applies to. If you mark a chunk in your installation package with one or more language specifiers, the console will determine at install time which chunk is the best match between the language needed by the user versus the languages in the package, and then download only the chunks which have been marked for that language and chunks that do not have a language specifier. Language specifiers can also declare a fall-back language if an exact match cannot be found.
Intelligent Delivery language specifiers tag content so that only a subset of all the localized assets in a package will be installed on any given console. This offers a bandwidth savings for customers installing digitally, as well as a hard drive space savings for all customers.
To specify that content is specific to one or more languages, add a Language attribute to a chunk in your layout.xml file. The following example shows a chunk that will be installed only on a console that determines French to be the best language match for the language that the console is running in. This chunk will be installed both on consoles that are set to French language with a Canadian locale (fr-CA) and on consoles with a French locale (fr-FR). Chunks without a language specifier will be installed on all consoles (unless excluded by other specifiers, such as device type).
<Chunk Id="1001" Languages="fr">
<FileGroup DestinationPath="\Data\Maps\X1\fr" SourcePath="Y:\Maps\Level1\X1\fr" Include="*.map"/>
<Chunk>
The existing GetUserDefaultLocaleName method has been updated to account for the language-aware install functionality of Intelligent Delivery. This API now returns the console’s installed language according to the data in your package’s layout.xml file and the console’s language setting. For more information about localization and AppXManifest.xml language settings, see the National Language Support API and Localization XDK sample.
Note You must ensure that all languages referenced within your layout.xml file are also present in your AppXManifest.xml file. If a language is used in the layout.xml file but are not present in your AppXManifest.xml file, that language will never be returned to your title as the recommended language to render in. Submission Validator will check for this scenario and produce a warning if this situation is found.
Some titles allow users to choose their language without regard to the language that their console is set to, either as part of first-time gameplay or through a menu. Intelligent Delivery installs only one language for a given package at install time, based on the language setting of the console and the languages specified in your layout.xml file. Your title should render in this language by default.
The Xbox Shell allows secondary languages to be installed in addition to the first language. You can also expose this choice to users from within your title using your own UI. Your title can determine which languages are available to be installed by getting the value of the PackageTransferManager.AvailableChunkSpecifiers property. Note that depending on the language selected and the install source, the install could come either from a disk or from Xbox Live. When a user selects a language other than the default, your title should call the PackageTransferManager.GetInstallationState method to determine the installation status of chunks tagged with that language. This API returns an InstallationState object with one of the values in the following table.
| State | Description |
|---|---|
| Installed | The language is already installed. |
| Pending | The language is currently being installed. |
| Available | The langauge is available but is not installed. Call the PackageTransferManager.AddChunkSpecifiersAsync method with the appropriate specifiers to install the assets. |
| Unavailable | The language is not available either online or in the version of the title on the disk. |
If a user chooses to install a language that is available but isn’t currently installed, your title should call the PackageTransferManager.AddChunkSpecifiersAsync method with a ChunkSpecifiers object that specifies the language to install. This call displays system-rendered UI that prompts the user to accept the additional download and installation. Your title can use the returned PackageTransferWatcher object to monitor the download and installation progress of the new data, or determine that the user has declined the additional install.
Your title can uninstall a language by calling the PackageTransferManager.RemoveChunkSpecifiersAsync method. This call will be silently ignored if only one language is installed.