共用方式為


Locale element

The Locale element specifies the locale of the device metadata package. A device metadata package must specify a single locale. In order to support multiple locales, separate metadata packages must be created for the same device.

Usage

<Locale
  default = "xs:boolean">
  text
</Locale>

Attributes

Attribute Type Required Description

default

xs:boolean

Yes

Must be false (0) or true (1). If the default attribute is set to true, the operating system uses this device metadata package as the default for the current locale of the computer.

Note  Note Only one metadata package for a device should set the default attribute to true (1). If more than one metadata package has the default attribute to true (1), the operating system randomly selects a metadata package for the device.

This attribute is required.

Text value

The data for the Locale element can be in the following format:

  • <Language>-<Region>
    For example, a value of 'EN-US' specifies the device metadata package is localized for the English language of the United States.

  • <Language>
    If only <Language> is specified, the device metadata package is localized for the specified language in all locations where the language exists. For example, a value of 'EN' applies to 'EN-US' and 'EN-BR'.

Child elements

There are no child elements.

Parent elements

Element Description

MetadataKey

The MetadataKey element specifies the attributes of the device metadata package. These include the following:

  • The identifier for each hardware function supported by the device.
  • The language-specific locale for the text strings within the package.

XSD

<xs:element name="Locale" type="tns:LocaleType" />

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

Remarks

The value of the Locale element must be one of the predefined constants and strings for locale identifiers used in multilingual applications. For more information about locale identifiers, refer to Locale Identifier Constants and Strings.

Each device metadata package specifies only one locale. Multiple metadata packages must be created for the same device if multiple locales are supported.

When it installs a device, the operating system uses the Locale element to select a metadata package in the following way:

  • The operating system first retrieves a list of preferred user locales on the computer.
  • If the Locale element of a device's metadata package matches an entry in the list of preferred user locales, the operating system selects the package for the device.
  • If the device's metadata packages do not have a Locale element that matches an entry in the list of preferred user locales, the operating system does one of the following:
    • If one of the device's metadata packages has the default attribute set to true (1), the operating system selects that package for the device.
    • If the device's metadata packages do not have the default attribute set to true (1), the operating system does not select any device metadata package for the device.

The Locale element is required.

See also

Device Metadata Packages

MetadataKey

 

 

Send comments about this topic to Microsoft