共用方式為


建立LocaleInfo.xml提交檔案

LocaleInfo XML 架構

裝置資訊清單提交套件必須包含一份LocaleInfo.xml檔,其中包含合作夥伴中心用來驗證裝置中繼資料套件中地區設定資訊的資訊。

LocaleInfo.xml檔中的資料會根據 LocaleInfo XML 架構格式化,如下所述。

注意

XML 檔必須使用 UTF-8 編碼來儲存。

如需位址範圍的詳細資訊,請參閱 如何建立裝置和印表機的裝置中繼資料套件

LocaleInfo XML 架構名稱空間

以下是 LocaleInfo XML 架構的命名空間: http://schemas.microsoft.com/Windows/2010/08/MetadataSubmission/LocaleInfo

LocaleInfo XML 元素/屬性的概觀

下表描述 LocaleInfo XML 架構的中繼資料元素和屬性。

元素/屬性 元素/屬性類型 必要/選擇性
MultipleLocale xs:boolean 選擇性
LocaleDeclaredInPackageInfo tns:LocaleDeclaredInPackageInfoType 選擇性
default xs:boolean 必要
SupportedLocaleList tns:SupportedLocaleListType 選擇性
Locale xs:string 選擇性

LocaleInfo XML 架構定義

以下是 LocaleInfo XML 架構定義:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://schemas.microsoft.com/Windows/2010/08/MetadataSubmission/LocaleInfo" xmlns:tns="http://schemas.microsoft.com/Windows/2010/08/MetadataSubmission/LocaleInfo" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" blockDefault="#all">

 <xs:element name="LocaleInfo" type="tns:LocaleInfoType" />

 <xs:complexType name="LocaleInfoType">
  <xs:sequence>
   <xs:element name="MultipleLocale" type="xs:boolean" />
   <xs:element name="LocaleDeclaredInPackageInfo" type="tns:LocaleDeclaredInPackageInfoType" />
   <xs:element name="SupportedLocaleList" type="tns:SupportedLocaleListType" minOccurs="0" />
   <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
  </xs:sequence>
 </xs:complexType>

  <xs:complexType name="LocaleDeclaredInPackageInfoType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="default" type="xs:boolean" use="required" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <xs:complexType name="SupportedLocaleListType">
    <xs:sequence>
      <xs:element name="Locale" type="xs:string" maxOccurs="unbounded" />
      <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>

</xs:schema>

LocaleInfo XML 架構參考

LocaleInfo XML 架構會定義下列元素和屬性:

  • LocaleInfo
    • MultipleLocale
    • LocaleDeclaredInPackageInfo
      • default
    • SupportedLocaleList
      • Locale

MultipleLocale 元素

MultipleLocale 元素會指定裝置中繼資料套件是否支援多個地區設定。 合作夥伴中心會使用此值來正確驗證套件。

<xs:element name="MultipleLocale" type="xs:boolean" />

備註 (MultipleLocale 元素)

如果裝置中繼資料套件支援多個地區設定,則 MultipleLocale 元素必須是 「true」。 如果裝置中繼資料套件只支援一個地區設定,元素可以是 「true」 或 「false」。 MultipleLocale 的值必須符合PackageInfo.xml中指定的值。

LocaleDeclaredInPackageInfo 元素

LocaleDeclaredInPackageInfo 元素會指定裝置中繼資料套件中宣告之地區設定和套件屬性的相關資訊。 合作夥伴中心會使用此資訊來正確驗證裝置中繼資料套件中宣告的地區設定中繼資料。

<xs:element name="LocaleDeclaredInPackageInfo" type="tns:LocaleDeclaredInPackageInfoType" />

<xs:complexType name="LocaleDeclaredInPackageInfoType">
  <xs:simpleContent>
    <xs:extension base="xs:string">
      <xs:attribute name="default" type="xs:boolean" use="required" />
    </xs:extension>
  </xs:simpleContent>
</xs:complexType>

備註 (LocaleDeclaredInPackageInfo 元素)

LocaleDeclaredInPackageInfo 元素必須符合PackageInfo.xml中指定的地區設定值。

預設屬性

預設屬性會指定裝置中繼資料套件是否為預設套件,如PackageInfo.xml所示。

<xs:attribute name="default" type="xs:boolean" use="required" />

備註 (預設專案)

預設專案必須符合PackageInfo.xml中指定的預設值。

SupportedLocaleList 元素

SupportedLocaleList 元素會指定裝置中繼資料套件中支援哪些其他地區設定。 合作夥伴中心會使用此資訊來正確驗證裝置中繼資料套件中的其他地區設定中繼資料。

<xs:element name="SupportedLocaleList" type="tns:SupportedLocaleListType" minOccurs="0" />

<xs:complexType name="SupportedLocaleListType">
  <xs:sequence>
    <xs:element name="Locale" type="xs:string" maxOccurs="unbounded" />
    <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
  </xs:sequence>
</xs:complexType>

Locale 元素

Locale 元素會指定裝置中繼資料套件中支援的額外地區設定。 如需合作夥伴中心如何使用此值的詳細資訊,請參閱 SupportedLocaleList 元素。

LocaleInfo XML 範例

下列 XML 檔會使用 LocaleInfo XML 架構來指定 LocaleInfo 資訊的元件。

此範例適用于支援 en-US、ja-JP 和 fr-FR 地區設定的裝置中繼資料套件。 它會列出 PackageInfo.xml 中的 en-US 地區設定,而且是預設的地區設定套件,如PackageInfo.xml所示。

<?xml version="1.0" encoding="utf-8"?>
<LocaleInfo xmlns="http://schemas.microsoft.com/Windows/2010/08/MetadataSubmission/LocaleInfo">
  
  <MultipleLocale>
    true
  </MultipleLocale>
  
  <LocaleDeclaredInPackageInfo default="true">
    en-US
  </LocaleDeclaredInPackageInfo>
  
  <SupportedLocaleList>
    <Locale>en-US</Locale>
    <Locale>ja-JP</Locale>
    <Locale>fr-FR</Locale>
  </SupportedLocaleList>
  
</LocaleInfo>