Applying Character Formatting
This section explains how to enrich the editor display in Trados Studio with character formatting.
Apply Character Formatting
The inline tags in the sample format make it easy to determine which character formatting to apply. Display formatting in an intermediary SDLXLIFF document is optional and does not affect the generated BIL target file. However, it helps translators recognize the intended formatting more easily. You can also hide inline tags and show only the formatting they represent. This approach lets translators apply formatting to the corresponding text in the target segment instead of transferring tags.
First, add the following namespace to your parser class: Sdl.FileTypeSupport.Framework.Formatting.
Then update the CreateTagPair() helper function so that it generates tag pairs and applies the appropriate formatting at the same time. Use a switch statement to select the correct formatting based on the element name:
// apply character formatting to the start tag
IFormattingGroup formattingGroup = PropertiesFactory.FormattingItemFactory.CreateFormatting();
startTag.Formatting = new FormattingGroup();
switch (item.Name)
{
case "b":
formattingGroup.Add(new Bold(true));
break;
case "i":
formattingGroup.Add(new Italic(true));
break;
case "u":
formattingGroup.Add(new Underline(true));
break;
default:
break;
}
The complete CreateTagPair() helper function should look like this. When you set CanHide to true, Trados Studio hides the actual tags by default. Users can still toggle tag display at runtime.

