Setting the Glossary Fields
Apart from the actual source and target terms, a terminology source can also contain additional information such as a definition, a note or an example. Such additional information is referred to as 'descriptive fields'.
How to declare the Definition Field
Our glossary text file foresees a definition text in the forth column:
1;photo printer;Fotodrucker;Peripheral device for creating hardcopies of pictures.
Such information can also be shown when looking up terminology in Trados Studio. When the descriptive field is declared, it can be selected in the Trados Studio UI:
If you select to display the field, the content (the definition) is shown alongside the search results:
Go to the MyTerminologyProvider.cs class and add the following member. It creates a descriptive field labelled 'Definition', which - in turn - can contain a text string. The example field has the field level 'Entry', i.e. it is not specific to a particular term or language. Instead, in the entry structure, it applies to the whole entry.
// Creates the termbase definition by declaring the Definition text field.
// This allows our terminology provider to also display the Definition field content
// in the Termbase Search and Terminology Recognition windows.
public IList<DescriptiveField> GetDescriptiveFields()
{
var result = new List<DescriptiveField>();
var definitionField = new DescriptiveField
{
Label = "Definition",
Level = FieldLevel.EntryLevel,
Type = FieldType.String
};
result.Add(definitionField);
return result;
}
This function then needs to be called from the following property, which also calls the GetLanguages() method to create the full terminology source definition. The terminology source definition then becomes exposed in the Trados Studio UI, where you can select what fields to display (see screenshot above).
//Creates the terminology source definition, i.e. the languages in the glossary and any
//additional descriptive fields, in this case the 'Definition' field
public Definition Definition
{
get
{
return new Definition(GetDescriptiveFields(), GetLanguages().Cast<DefinitionLanguage>().ToList());
}
}