Binding a Translation Table to a Class

[This is preliminary documentation and subject to change.]

To bind a translation table to a class, attach the Lexicon standard qualifier to the class. A translation table is an instance of the __Lexicon system class that includes all of the strings to be localized for a class or any or all of its elements. A translation table can be bound to an entire class, handling the translation for all of the instances of the class, or to an individual instance or property.

The Lexicon qualifier specifies the GUID property of a __Lexicon class instance. The following class definition shows how to attach the Lexicon qualifier to the class to bind the translation table to the entire class:

[Lexicon("{e588652-edb5-11d0-00c04fb68820}"), Locale("ms\\0x409")]
class MyClass
{
    string Tree;
    string Dog;
    string Pencil;
}
 

To bind a private translation table to a particular property, attach a Lexicon qualifier to the property. The following class definition specifies one translation table for the class and another translation table for the Pencil property:

[locale("ms\\0x409"), Lexicon("{e588652-edb5-11d0-00c04fb68820}") ]
class MyClass
{
    string Tree;
    string Dog;

    [Lexicon("{d224344-dcd5-24b1-00c12cd24464}")]
    string Pencil;
}

The translation table translates the value of the Pencil property rather than its name. The translation table attached to the class is used for the name of the property.

To use the special translation table that WBEM provides for translating system properties and standard classes, attach a Lexicon qualifier and set GUID value to all zeroes:

[Lexicon("{00000000-0000-0000-000000000000}"), locale("ms\\0x409")] 
class MyClass
{
    
}

Note  Associations are not used to bind a __Lexicon instance to an intended class because some classes include a different instance for each property. Associations are not meant to relate individual properties to instances of classes.