Translation - Μετάφραση

Resources, Technical Assistance and Technology News => CAT Tools Tips and Assistance => Translator resources => SDL-Trados => Topic started by: spiros on 02 Oct, 2015, 14:44:00

Title: How to use your Office AutoCorrect entries in SDL Studio (or any other Windows application)
Post by: spiros on 02 Oct, 2015, 14:44:00
How to use your Office AutoCorrect entries in Studio (or any other Windows application)

Studio 2015 has a new feature which is much like Microsoft Office AutoCorrect. Studio 2015 has preloaded entries with typical errors for most languages. You can export and import these Studio 2015 AutoCorrect files.

But how can you add/use the AutoCorrect entries from Microsoft Office?
There are various ways of going about it.

All sample files attached as Studio-AutoCorrect-Import.zip

1.
For ages, I have been using Asutype (http://www.asutype.com), a program which lets you use AutoCorrect entries in any Windows application. This worked perfectly until Studio 2015.

When using Asutype 5.1 (free one month demo, buy at 39.95$) with SDL Studio 2015 some of the text expansions may fail if Autosuggest is also triggered by the expanded or corrected version of the word/phrase. For example, I have the autocorrect entry in Asutype

χρηματα | χρήματα

When I type "χρηματα", Asutype tries to turn it into "χρήματα" but it goes as far as "χρή" at which stage the Autosuggest kicks in. Result: failure. (It is to be noted that this issue does not affect previous versions of Studio). See a video illustrating that:

SDL Studio 2015 and Asutype incompatibility - YouTube (https://www.youtube.com/watch?v=qjzLfbjUSY4)

So, if anyone in SDL (Paul?) or Fanix (Van?) is listening, please try to sort this out.
Edit: This was solved from SDL at a later stage.

2.
Another way is to use PhraseExpress (http://www.phraseexpress.com/), which is free for personal use. It is afflicted by the same problem—mentioned above—as Asutype (hence this should be the responsibility of SDL to look into). Another issue that may occur with this: it may only import your main language AutoCorrect entries from Office. You can resolve this though by using the export macro below (tab delimited) once you have changed your machine language to the language of the desired AutoCorrect entries. Then, paste the two columns to an Excel sheet (they are deliberately exported with the first column having the corrected/expanded versions of the entries!) and import to a PhraseExpress folder. PhraseExpress will present you an option to automatically eliminate duplicates.

Code: [Select]
Sub AutocorrectTabsReverse()
   Dim a As AutoCorrectEntry
  For Each a In Application.AutoCorrect.Entries
    Selection.TypeText a.Value & Chr(9) & a.Name & vbCr
  Next
End Sub

The best way to insert this would be to press ALT+F8 in Word and, if you already have other macros there, press Step Into, and then paste your macro above all others and then Save and Close. Then, to access your macro from Word, you will press ALT+F8 and select the macro name and click Run. If you don't have any other macros, record a macro, stop it immediately, and then follow the aforementioned procedure by overwriting the recorded macro text.

Also, you can add more entries in this program but if you want to export them into a different format it will be impossible, as the only available option is their custom encrypted text format. I have posted numerous times on their Forum about this and as a result my posts have been deleted some time after replying with a lame excuse. I posted today a question about the inability to import entries for different languages and the result was that not only my post was deleted, but my account too. Thumbs down PhraseExpress people.

So this is not a perfect solution—mainly for the cryptic export format hindering data exchange between similar programs. If you are not bothered about this, then it will do the job just fine.

Export AutoCorrect - YouTube (https://www.youtube.com/watch?v=rRVo-Ld2msU)

See also: Autocorrection and autocompletion (http://tradosstudiomanual.com/?p=414)

3.
There is a third approach which is more organic to Studio 2015.

1.   Export the Studio 2015 AutoCorrect file of the language you need.
   a.   File > Options > Editor > AutoCorrect
   b.   Select Target language.
   c.   Click Export settings.

2.   Switch to the language of the AutoCorrect entries in Microsoft Word and use this macro to export AutoCorrect entries in Studio format:

Code: [Select]
Sub AutoCorStudio()
  Dim a As AutoCorrectEntry
  For Each a In Application.AutoCorrect.Entries
    Selection.TypeText "<Entry src=" & Chr(34) & a.Name & Chr(34) & " trg=" & Chr(34) & a.Value & Chr(34) & " />" & vbCr   
  Next
End Sub

(https://www.translatum.gr/forum/index.php?action=dlattach;topic=399434.0;attach=5300;image)
The export macro

(https://www.translatum.gr/forum/index.php?action=dlattach;topic=399434.0;attach=5301;image)
Exported Microsoft Word entries

Go to step 5

Or, if you want to eliminate duplicates (https://www.translatum.gr/forum/index.php?topic=49093.0) in Excel, use the macro below and then once you eliminated duplicates Go to step 3.

Code: [Select]
Sub ExportAutocorrectTabs ()
   Dim a As AutoCorrectEntry
  For Each a In Application.AutoCorrect.Entries
    Selection.TypeText a.Name & Chr(9) & a.Value & vbCr
  Next
End Sub

Alternatively,
Export Office AutoCorrect entries using the attached macro: AutoCorrectMulti.dot and then eliminate duplicates (https://www.translatum.gr/forum/index.php?topic=49093.0) in Excel should you need so (the benefit of this macro is that you can just click on it and run it).

   a.   Run the macro AutoCorrectMulti.dot. (If you have problems running it go to
        Tools →  Macro → Security and select Low).
   b.   Select Backup and then the language of the entries
   c.   Save the file.
 
3.   Paste each column of the exported Office AutoCorrect entries in the empty columns in the attached xls file (2oct2015a.xls). Use Sheet 2, Column B for Find, Column D for Replace. Copy the text below Columns A, C, E so that it populates all rows containing AutoCorrect entries.

4.   In Column F drag the bottom right corner all the way down to create a merged version of the columns. It uses this formula:

=CONCATENATE(A1;B1;C1;D1;E1)

If it does not work in your machine change the Formula in F1 cell to:

=CONCATENATE(A1,B1,C1,D1,E1)

and drag (or simply click on the bottom right corner of the last populated cell to copy down).

Alternatively, you can use ASAP Utilities (https://www.asap-utilities.com/)' (free) Merge function (https://www.asap-utilities.com/asap-utilities-excel-tools-tip.php?tip=61) to merge all columns. (The resulting text should be as it is in Sheet 3 of the 2oct2015a.xls)

5.   Paste the resulting text into the Studio 2015 AutoCorrect file (which you better open using Notepad++). For example, paste in the row after <AutoCorrectEntries> in the file greek-test.autoCorrect (attached) and save (make sure UTF-8 is used for saving).

(https://www.translatum.gr/forum/index.php?action=dlattach;topic=399434.0;attach=5298;image)

6.   Import the modified Studio 2015 AutoCorrect. You can either maintain the existing entries, or just add only your entries. For the former, use the original file you exported from Studio 2015 (attached sample for Greek greek.autoCorrect) and paste your entries after <AutoCorrectEntries>. Either way, make sure that there are no duplicates (attention: Studio is case insensitive in its approach to duplicates); if duplicates are found the import will fail with the error: "Failed to read settings from import file. Check if the file is a valid AutoCorrect settings import file".

(https://www.translatum.gr/forum/index.php?action=dlattach;topic=399434.0;attach=5297;image)

7.   For the replacements to work, make sure you have checked the Replace text as you type text box.

(https://www.translatum.gr/forum/index.php?action=dlattach;topic=399434.0;attach=5321;image)

If you are also running a text expansion program (like I do), make sure you disable it when you work with Studio 2015!

4.

A fourth option for AutoCorrect functionality in all Windows programs would be using AutoHotkey (http://ahkscript.org/) as elaborated in Paul Filkin's post (https://multifarious.filkin.com/2013/05/31/autocorrect-for-everything/), but it could have issues with non-Latin scripts (even when using the Unicode version).

Comments
— Studio 2015 could offer importing Office AutoCorrect entries the same way PhraseExpress does it, or at least importing in csv/tsv format.
— Studio 2015 could import entries and offer an option to merge with currently existing ones or not. If merging there should be an option to automatically deal with duplicates rather than displaying a general error.