One of the most annoying and stressful problems to encounter after processing a document in a Translation Environment Tool is finding out that the target file cannot be created due to some obscure and vague error. This type of scenarios is relatively common – it has actually just happened to me – so I thought that this would be a good opportunity to write a short article about this issue.
This error usually stems from missing tags, tags that were mishandled by the TEnT, or problems in the underlying structure of the source file.
The good news is that there are best practices to follow for diagnosing these issues in a timely manner before the work starts, preventing them during the work, and solving them even after the work has been completed. There are no guarantees because there are almost an infinite number of project-specific parameters, including the file type and the specific TEnT with its unique quirks, that vary between projects, but in most use-case scenarios following these best practices will save a lot of time, frustration and stress at the end of the project.
I’m using SDL Studio 2014 as my main TEnT and therefore will focus mostly on working with it, but these best practices should apply to all other TEnTs, with the necessary adjustments to account for each tool workflow and intrinsic “quirks”.
Best Practices for Making Sure That the Target Document Can be Created at the end of a project
The first best practice is to try and save the target document right after it was opened in the TEnT. In SDL Studio this is invoked from the Editor view by pressing the Shift+F12 keyboard shortcut for via the File > Save Target As menu command. In case of any structural issues in the source file that prevent saving the target document in its original format, they will be discovered at this point, which is the best timing during the project to learn about them because there is enough headroom to perform all the necessary corrective actions and adjust the project timetable and/or fee as necessary.
If the target file was created successfully it means that the structure of the original file is intact, and any further error is most likely associated with missing inline tags, an issue that can be easily corrected.
To avoid accidental deletion or omission of inline tags it is recommended not to work with a visual editor (the one displaying the text in its final formatting without the tags that control that formatting) and set-up the TEnT to display all tags instead.
In SDL Studio:
- Click File > Options;
- Select the Editor sub-menu from the left pane;
- From the Formatting display style dropdown list, select Show all formatting and tags;
- Click OK to confirm and exit.
- It is important to note that the amount of tag information that is displayed for each tag In the Editor windows can be controlled, as explained by Paul Filkin in his article Simple guide to working with Tags in Studio which I recommend reading to better understand how to work in tags. Displaying the full tag text can come in handy when needing to understand what formatting a tag represents, while still keeping all tags visible.
Corrective Actions to solve an Error when Trying to Create the Target Document
If you followed the first best practice (trying to create the target document after opening the file in the TEnT) and an error occurs, it means that there is an issue with the structure of the source file that must be resolved before the translation work starts. It is important to pay attention to the error details because sometimes they can point to the source of the problem and allow a more targeted approach for fixing it.
The following corrective actions are displayed in the order that I think is the recommended procedure to go about solving a general and unspecific target document creation error, but they can be used in any order.
Note: Before stating to do anything, create a backup copy of the original file. If the error occurred at the end of translation, make sure to save the Bilingual file and update or create a TM to use later with the new source file.
Open and Repair the Document
From my experience most of the more persistent errors of this type seem to be associated with Word documents. Because these issues usually stem from a structural error in the source file, trying to repair the file using Word’s Open and Repair command is a good starting point:
- Open Microsoft Word;
- Click File > Open and navigate to the source file;
- Instead of clicking Open, click the down-arrow in the Open button and select the Open and Repair command.
Saving the Source File in Another File Format
All word processors file formats support basic and common text formatting such as Bold, Italics, Underline, Color, etc., but use a different underlying structure for storing the data. Saving the original file in another file format – specifically one that supports less “complex” features – can remove some common underlying structures that are known to get broken or mishandled, while still maintaining all or most of the visual formatting. The recommended file format to use is the RTF (Rich Text Format) file format. Generally it is considered safe converting the original file into RTF without worrying too much about losing key formatting or functionality.
If the RTF conversion doesn’t work, I also suggest to try saving as DOC and DOCX file formats (in Microsoft Word and depending on the original file format), or as ODT if using another word processor that support this file format.
Now, try to import or open the converted file in the TEnT and create the target document.
Removing all Bookmarks from the Document
Word documents can contain bookmarks such as Table of Contents and Cross-references that are sometimes get broken, or mishandled by the TEnT. SDL Studio is quite known for mishandling some bookmarks at times (at seems a bit at random), so this clause is specifically relevant to Studio users.
The solution in this case is to remove all bookmarks from the original document and then process it again in the TEnT. If these bookmarks are important for the functionality of the file they need to be added after the target has been created.
There are two ways to remove the bookmarks from the document:
If there aren’t many bookmarks in the document and/or if after consulting the error message details you know which bookmark is likely to be responsible for the error, it might be more effective to remove the bookmarks one-by-one until the culprit is identified.
To display the bookmarks list:
- Select the Insert Ribbon tab in Microsoft Word;
- From the Links Ribbon group select the Bookmark command;
- Select the Hidden bookmarks checkbox at the bottom of the windows to display all bookmarks in the document;
- Select the required bookmark and click the Delete button to remove it.
2. Using a Macro to Automatically Remove all Bookmarks from a Document
If the document has a lot of bookmarks it is not very practical to remove them manually. Fortunately, a Macro is available to remove all the bookmarks (including the hidden ones) at one fell swoop. The following Macro code is taken from Microsoft’s Support website.
Dim stBookmark As Bookmark
ActiveDocument.Bookmarks.ShowHidden = True
If ActiveDocument.Bookmarks.Count >= 1 Then
For Each stBookmark In ActiveDocument.Bookmarks
Removing AutoText fields (corresponds to the Enumeration already finished error
When working with DOCX siles, the Enumeration already finished error is a Special Case of the general Failed to Save Target As error. This error is most likely the result of AuoText Entries. The following instructions on how to delete the AutoText Fields are based on the Delete an AutoText entry article (that refers to Word 2003) by Microsoft, but refers to Office 2010 and 2013:
- On the Insert tab, select the Quick Parts menu under the Text group, and then the Building Blocks Organizer… command.
- Sort the entries by the Gallery column.
- Click the name of the AutoText entry that you want to delete and then the Delete button.
Note: Deletion of an AutoText entry cannot be undone. The only way to restore an AutoText entry is to create it again manually. Therefore, use with caution.
Due to the possible issues that deleting AutoText entries could have on other or future documents, a more safe approach in my opinion is to save the original document in a DOC format, translate it, and in the end save it back as DOCX; if the error occurred after the translation is already complete, save the file in a DOC format and re-translate it using the existing Translation Memory./p>
Running the tool’s built-in Tag Verification
If you forgot to test save the target document before starting the work only to find out that an error occurs at end, or if the target document was created successfully at the beginning of the work but now an error occurs, the first action to take is running the TEnT’s built-in Tag Verification function and correcting any tag-related issues that it identifies.
In SDL Studio the Tag Verification is invoked by pressing the F8 Keyboard shortcut, or from the Review Tab > Quality Assurance group > Verify command.
Note: Some formatting tags like font color, Italics, Bold, superscript etc. are sometimes omitted by the translator on purpose. However, if a target saving error occurs, make sure to add all the missing tags that were identified by the Tag Verification function; even those that were removed intentionally (just add them to the appropriate segment but don’t enclose any text within them).
Not being able to create the translated document after processing it using a TEnT is quite stressful because there is no clear corrective action to take and the deadline and/or start of the next project are nearing.
In this article I have attempted to offer several best practices for diagnosing this error at the beginning of the project to allow for any resulting adjustments to the timetable and/or fee for correcting the issue, preventing accidental deletion of tags during the transition process, and some recommended corrective actions.
Leave a Reply to Shai Cancel reply