Re: Fields in document

More
9 months 4 weeks ago #70 by Serg89
Fields in document was created by Serg89
Hello!
Is there any way to replace fields with the text?

P.S. Thank you for transtools! Its very usefull!
Attachments:

Please Log in or Create an account to join the conversation.

More
9 months 4 weeks ago #71 by stanislav
Replied by stanislav on topic Re: Fields in document
Hello Serg,

It depends on the type of field. Document Cleaner (TransTools for Word) includes a special quick action that converts tables of contents within the selected text or at the cursor position to regular text. See prntscr.com/vpn2e6

For all other types of fields, you can convert fields to text using the following procedure:
1) Press Alt+F11 to open Visual Basic Editor.
2) In the current document, select the text that contains the fields you want to convert to text. Make sure that all the fields contain the correct text since the fields will be replaced with the current display text (if they are not updated, update the display text by right-clicking fields and selecting Update or by pressing F9 on selected text).
3) In Visual Basic Editor, press Ctrl+G to open the immediate window at the bottom.
4) Type the following:
Selection.Fields.Unlink
and press Enter key
5) Now the fields will be converted to text.

I advise you to navigate fields before you do this (by clicking the small ball at the bottom of the vertical scrollbar in the document window and selecting Field icon, then clicking the blue double arrows to navigate between fields). Fields include hyperlinks and some other types of Word elements, so if you want to preserve such types, you will need to write a macro that goes through all fields, checks the type of field and only unlinks the required types of fields.

Best regards,
Stanislav

Please Log in or Create an account to join the conversation.

More
9 months 4 weeks ago #72 by Serg89
Replied by Serg89 on topic Re: Fields in document
Thank you for your prompt reply!
I tried to apply all the special quick actions for these fields – no effect.
But your VBE method has worked and really helped – thanks a lot!
Sometimes, after unloading a document from SMARTCAT (when the tags are saved by translators) such fields are shown with an error (Error! Reference source not found), and sometimes everything looks fine. Do you know a way to identify such problem fields automatically?
And in the next versions of TT it would be great to have (if possible) a button to replace these fields with text, with the result as in your VBE method.

Best regards,
Serg

Please Log in or Create an account to join the conversation.

More
9 months 4 weeks ago #73 by stanislav
Replied by stanislav on topic Re: Fields in document
Hi Serg,

Thanks for your feedback.

I am planning to add field-related functionality to TransTools+. I will add your recommendation to my to-do list.

Fields are really tricky. On the one hand, it is always better to preserve them as field because your customer may need to edit the translated document and update those fields. On the other hand, they cause issues during translation if translators are not careful with their order or if they copy similar tags from other segments. I personally recommend not to replace them with text and instead ask translators to be extra careful with them, or even re-insert them during the proofreading step for those translators who tend to cause problems.

As for 'Error! Reference source not found' error, it often occurs with REF field. This field displays the text referenced by a specific bookmark. If you delete the bookmark before importing into the CAT tool (e.g. you remove all bookmarks to minimize tags), or if you remove part of a document that contains that bookmark, the REF field will display this error when it is updated. Also, the error may occur if the bookmark-related tags are not preserved during translation in the CAT tool. So, to avoid this error, there are some recommendations:
- If you delete bookmarks, make sure to delete unreferenced bookmarks only, i.e. bookmarks that are not referenced from any fields. Tag Cleaner command in Document Cleaner tool ( www.translatortools.net/products/transtools/doccleaner ) has an option to do this.
- When doing the proofreading step in SmartCAT, perform all tag-related QA checks, or even find all segments containing tags and reinsert tags into the target.
To find the issue in the final document, search for 'Error! Reference source not found', then press Alt+F9 to show field codes and see the name of the bookmark listed in the field source. Then find this bookmark in the source file and reinsert this bookmark into the final file.
In Forget-me-not tool ( www.translatortools.net/products/forgetmenot ) I am planning to detect fields that reference bookmarks and warn about them in the report, so that the PM / translator is more careful.

Best regards,
Stanislav

Please Log in or Create an account to join the conversation.