Adding a new inline tag
Introduction
This document shows inline tags can be added manually to the translation. This will be illustrated using an html, a docx and an xml file.
The respective import results are shown below.
This is the docx file.
And here is the html file.
Inserting a general tag
The most reliable way of inserting an inline tag to the target side is by using the tag commands to copy inline tags from the corresponding source side. If this is not an option, there are two alternative solutions:
copying an inline tag, like any other character from a different segment,
creating an inline tag manually.
The first option is simpler, but it cannot be used in case of tags that are not even present in the file. The second option is described in detail now.
The sample html file contains only underlined formatting and we want to introduce italic formatting in the translation. This can be done by using the Insert New Inline Tag command, as show below.
The Insert New Inline Tag command brings up a form, as shown on the picture below, where the details of the inserted tag can be specified. The name of the inline tag can be selected from the list of tag names allowed in the file format corresponding to the document. In case of html the i and b tags are allowed, while the rpr is not, while for docx files this is the other way around.
Adding an open and a close b tag to the html file results in bold formatting of the letter inside the range defined by the tags, see the following image.
In some cases, it is not enough to add a tag with a given name, but the tag needs to contain certain attributes and their value should be such that it resembles tags that would be generated during the import of the original file. If an inserted tag does not meet this requirement, then it may result in the export of the file failing with a general error message.
Particular cases:
Adding bold formatting or a newline to html files is fairly straight forward. However, there are cases that need a bit more care or they are not even possible.
- Formatting in Office and Adobe files
The example docx file contains text highlight and a comment range represented by inline tags. In case of rpr tags there is a mandatory id attribute and a transform attribute on the closing tags which has to have the “close” value, see the picture below. These ids match an rpr tag to a certain formatting that was present in the file (in this case the Normal style + highlight). Not setting these attributes correctly can result in unexpected behavior and the list of possible id values depends on the source file. Moreover, the given id number represents a given formatting only in the scope of a document. The 0 id can represent different formatting in different documents.
Similar considerations have to be kept in mind in case of inline tags representing formatting, comments, footnote references, links and other objects from non-plaintext file formats (ex. Adobe formats, Office formats, …).
- Translatable attributes
Inserting tags with attributes that would import for translation if they would appear in the original file is not possible. An example is the title attribute of a tag in html.
This picture shows the Insert New Inline Tag command when adding an empty a tag with a title attribute. If such a tag is inserted, it will result in a QA error as shown on the picture below.
- Null attributes
In case of xml based formats (xml, html, dita, …) it can happen that inline tags contain attribute-like markup. These are flags whose presence contains the information. It is not possible to insert flag attributes while manually inserting a new inline tag.
Such an example is given in the sample xml file when imported with the attached configuration.
This picture shows the file content to be imported, the translation grid with two tags and the preview. The first inline tag is the one copied from the source side, the second tag is inserted manually. The difference between the two tags is visible in the viewpane. The original tag contains a flag attribute, while the manually inserted tag displays the attribute with an empty string value. This difference is present in the exported file as well.
Comments
0 comments
Please sign in to leave a comment.