Monday, February 19, 2018

Do you speak Trados?

One of the most frustrating things for me when I was first learning how to use Trados was not knowing the jargon when I was trying to ask a question or discuss an issue. Now that I've become a bit more familiar with SDL Trados Studio, I find that colleagues who are new users also struggle with this. These short definitions are my contribution to help improve this issue.

There are only a few for now, but I'll be adding more definitions over time.







Sunday, February 4, 2018

When One Keyboard Isn't Enough

Today I thought I'd share with you a little toy I have sitting next to my keyboard that makes my life a little easier: an X-Keys keypad. It looks just like this:



What is it?
You can probably tell just by looking at it: it's 24 additional programmable keys. So, does that mean you can program 24 actions/macros/functions with an X-Keys keypad? No, you can actually program more, as each key can be programmed to do something different depending on which application is open, plus there are layers.

The keypad is programmed with a bundled program called MacroWorks 3.1. Here's a list of features from the manufacturer's website:





The keys are backlit, and you can choose either blue or red, and even choose the backlighting on an individual key basis. I have turned off the backlighting altogether, so that's also an option.

What do I use it for?

First, I have to say that even though I have all these keys at my disposal, I find myself using about half most of the time, the bottom half to be precise, and also sometimes the right column. The bottom right key is my "Confirm" key in the various CAT-tools and environments I use: SDL Trados Studio, as my main CAT tool, but also Wordbee, MemSource and occasionally MemoQ. Other SDL Trados Studio related actions include frequent actions, such as Concordance, Quick Add New Term or Filtering. Other keys perform functions such as:
  • Launch the Find and Replace dialog
  • Open specific folders
  • Launch or switch focus to specific programs
  • Type characters that are not readily available on my Spanish keyboard layout, such as >, <
  • Dedicated keys for straight and curly quotation marks, so no more switching between the two kinds
  • Launch AutoHotkey macros (particularly useful when I assign a finger-bending key combination to an AHK script, such as Ctrl+Shift+Alt+Q)
  • Mouse left and right clicks
  • Zoom in and out in programs like InDesign
  • Copy, cut, paste
  • Backspace
You get the idea... Here's a partial list of my key assignments:



How difficult is it to program?
Not difficult at all! You just open MacroWorks, either by pressing a little button on the back of the keypad or via Windows, and you can go to an interface where you choose a key, assign an action to it and save it. Key assignments can be stored in the hardware itself or in the software. 

To make things easier while programming your keys, there are four options to enter a macro event: Text, Keystrokes, Shortcut, Function, all quite self-explanatory.

Here I'm assigning a button to launch BaccS, my translation management software:




My only complaint* is that when I first got my keypad, MacroWorks was perfectly functional and responsive, so much so that I would often change key assignments depending on what I was doing, since it could be done in seconds, but at some point, it started getting really slow, and now it takes a bit (or a lot) of patience to add new key assignments, as the software has become quite unresponsive, even with the latest updates. I would show you a little video, but it might be more fun to watch paint dry. Really, it's that slow, at least on my system. This doesn't seem to be a widespread issue, though, and I probably just need to find the time and the right support to troubleshoot it.

*Update: Writing this post inspired me to seek some support with my issue, and PI Engineering replied to my email quickly, offering a solution, which worked perfectly, so MacroWorks is quite fast once again. If you use Windows 10 and are experiencing speed issues with MacroWorks, see the bottom of this post for the fix.


Final words
My X-Keys keypad is one of my favorite computer add-ons. When I'm on the road, I really miss it and can feel the difference it makes when I'm back and using it again. It's one of those little things that can help increase productivity. And every little bit counts!








-------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------

Fix for the MacroWorks 3.1 speed issue in Windows 10, as provided by P.I. Engineering support:

First lets elevate some permissions and run the software in “compatibility mode for WIN 7” . Go here C:\Program Files (x86)\PI Engineering\MacroWorks 3.1  and for the following entries:
MacroWorks 3 Launch
MacroWorks 3g
MAcroWOrks 3r
Macroworks3r.vshost
Right-Click and select “Properties>Compatibility Tab” place a checkmark in the “Run this program in compatibility mode for: (Win7)” box and the “Run this program as an administrator” box, then select “Apply” and reboot the computer entirely for the changes to take effect.



Tuesday, November 14, 2017

Replace All that Really Means Replace All

When doing a find and replace operation in SDL Trados Studio, clicking Replace All right after entering your find and replace strings does nothing: you have to click Find Next first, then click Replace All.

This has long been a pet peeve of mine, so I thought I would try and find a way to make this behavior more similar to what happens in MS Word, where clicking Replace All really does mean that all found instances will be replaced at once, and I'm happy to report that I've found a solution that works well for me.

What I needed was a way to still click Replace All and have that automatically go click Find Next and then Replace All again, without me having to do anything else.

To accomplish this, I used AutoHotkey. Here's how you can implement this simple solution yourself.

Warning: This works for the English interface of Studio. If you use a different language and would like to adapt it, follow the steps at the end of this article.

Step 1: AutoHotkey should be installed (if needed, you can download it here)

Step 2: Download my Replace All AutoHotkey script, and load it by double-clicking on the file.

To use the script, open Find and Replace as usual, filling out the necessary fields and checking the necessary checkboxes. Once everything is ready, simply click Replace All and the script will take care of the rest, clicking Find Next, then Replace All again, as required by Studio.

Script breakdown

;------------------------------------------------------------------------------
;Replace All no longer requires "Find Next" first, by Nora Díaz
;------------------------------------------------------------------------------
~LButton::
ifWinActive Find and Replace
{
  MouseGetPos,,,,Ctrl

  if (Ctrl = "WindowsForms10.BUTTON.app.0.29531c8_r9_ad19")

  {

  Controlclick, Find &Next, Find and Replace
  Sleep 1000
  Controlclick, R&eplace All, Find and Replace

  }
}
Return

Explanation
The script first determines if the button being clicked is the Replace All button, which is designated by its ID WindowsForms10.BUTTON.app.0.29531c8_r9_ad19:

  MouseGetPos,,,,Ctrl

  if (Ctrl = "WindowsForms10.BUTTON.app.0.29531c8_r9_ad19")


If the Replace All button has been clicked, then the script triggers a series of events where it clicks the Find Next button in the Find and Replace window and then the Replace All button in the Find and Replace window.

  Controlclick, Find &Next, Find and Replace
  Sleep 1000
  Controlclick, R&eplace All, Find and Replace

I find that the delay between clicks is necessary to give the script the time to find the next instance of the text to be replaced. When the delay is too short, the two buttons are clicked quickly in succession and nothing happens, as Studio has not had enough time to find the first instance to be replaced.

Adapting the script to work with other languages
Since button and window names obviously change depending on SDL Trados Studio's interface language, the script above will only work for the English interface. However, this can be easily adapted to work with other languages, by replacing the information highlighted below with the appropriate language text.

;------------------------------------------------------------------------------
;Replace All no longer requires "Find Next" first, by Nora Díaz
;------------------------------------------------------------------------------
~LButton::
ifWinActive Find and Replace
{
  MouseGetPos,,,,Ctrl

  if (Ctrl = "WindowsForms10.BUTTON.app.0.29531c8_r9_ad19")

  {

  Controlclick, Find &NextFind and Replace
  Sleep 1000
  Controlclick, R&eplace All, Find and Replace

  }
}
Return

The yellow highlights are for the button names, while the blue highlights are for the window names.

To figure out what should be used to replace the highlighted text, have a look at your window in Studio. For example, for Spanish, the Find and Replace window looks like this:


The window is called Buscar y reemplazar
The buttons are called Buscar siguiente and Reemplazar todo

An ampersand (&) is needed right before the letter designated for the Alt shortcut in the button, which appears underlined in the buttons in the image above, so the text to be used in the script should be:

Buscar &siguiente
Ree&mplazar todo

Thus, the modified script for Spanish (which you can download here) would look like this:

;------------------------------------------------------------------------------
;Replace All no longer requires "Find Next" first, by Nora Díaz - Spanish
;------------------------------------------------------------------------------
~LButton::
ifWinActive Buscar y reemplazar
{
  MouseGetPos,,,,Ctrl

  if (Ctrl = "WindowsForms10.BUTTON.app.0.29531c8_r9_ad19")

  {

  Controlclick, Buscar &siguienteBuscar y reemplazar
  Sleep 1000
  Controlclick, Ree&mplazar todoBuscar y reemplazar

  }

Return

That's all it takes to adapt the script, but if, like me, you're learning about AutoHotkey and would like to know where this information came from, here's a little extra information.

While initially working on this script, I used AutoHotkey's Window Spy to determine the correct window and button names. To access this useful tool, right-click on the green AutoHotkey icon of any running script and select Window Spy, then click on the desired window, in this case Studio's Find and Replace window.

For the example below, I clicked on the Replace All (Reemplazar todo) button.


Tip: Use Win+A to freeze the display; otherwise, the information changes whenever you move the mouse. Use Win+A to unfreeze.

So, that's all. If you find this script useful and adapt it for other languages, feel free to share it in the Comments section for other users who may benefit from it.

And, of course, any improvements from more advanced AutoHotkey users are more than welcome!


Thursday, July 13, 2017

Searching File Contents in Translation Memories and Termbases (or Any File!) in Windows Explorer

While working on a Studio project that has old or multiple TMs, I often find myself trying to remember which TM was used for a specific topic or part of the project, and then opening multiple TMs and searching for key words until I find the one I need.

During a particularly frustrating hunt for the right TM today, it occurred to me that there had to be a faster and easier way. If only Windows were able to search the content of my Translation Memory and Termbase files the way it can search the content of other file types... Well, it turns out there is a way, and it's not terribly complicated to set it up.

Here are the steps for Windows 10, in case anybody else finds this useful.

1. Go to the Start menu and search for "Indexing Options"

2. Click the Advanced button

3. Go to the File Types tab

4. Locate the sdltm extension, and after selecting it, click the Index Properties and File Contents radio button. The Filter Description will change from File Properties filter to Plain Text Filter. Repeat with the sdltb extension (or any other file extension, for that matter).


 6. Click OK to close everything and exit Indexing Options.

It may take a while for your computer to reindex the files, but you should now be able to go to Windows Explorer, open a folder where TMs or Termbases are stored, do a search, and have the relevant TMs or Termbases be listed in the search results.








Tuesday, January 10, 2017

Autopropagating Segment Status in Review Mode in SDL Trados Studio

Aug. 2017 Update: This issue has been resolved in Studio 2017 SR1.

The problem: When in Review mode in Studio, segment status for repetitions is not propagated when Track Changes is on and no edits are made to the segment.



The workaround: An AutoHotkey script that disables track changes right before confirming the segment, then enables track changes again after the segment has been confirmed.



Until a change is made to Studio to allow segment status to propagate in all instances, the following workaround can be used to achieve the desired effect.

Step 1: AutoHotkey should be installed (if needed, you can download it here)

Step 2: Download my Review Macro AutoHotkey script, and load it by double-clicking on the file.

Script breakdown

$^Enter::  ;This is the hotkey (Ctrl+Enter, adapt if your Confirm and Move to Next Segment shortcut is different)
Sleep 300  ;a short delay before the script execution starts, for better reliability
Send, ^!{F10}  ;Toggle track changes off
Send, ^{Enter} ;Confirm segment (Ctrl+Enter, adapt if your Confirm and Move to Next Segment shortcut is different)
Send, ^!{F10} ;Toggle track changes on
Send, {Esc}
Return

#s::  ;Hotkey toggle to suspend/resume the macro (Windows Key+S)
Suspend
if (A_IsSuspended)
MsgBox, Review Macro suspended
else
MsgBox, Review Macro active
Return

Explanation
Once the script is loaded, to use it you would simply confirm your segments as you usually do (assuming that you use Ctrl+Enter as your shortcut; if not, adapt the script as needed). When the Confirm and Move to Next Unconfirmed Segment shortcut is used, the script will toggle Track Changes off, confirm the segment, then toggle Track Changes back on. What this means is that segment status will be correctly propagated, as Track Changes will be disabled right before confirming the segment, regardless of whether changes were made or not.

Warning notes:
1. If the script is loaded while in translation mode, there may be some undesired effects when the shortcut is used, as track changes is toggled on and off every time a segment is confirmed. Due to this, it's best to only load the script when in review mode and unload it once the review is done. To learn how to load and unload AutoHotkey scripts, watch the short video below.



2. For the script to work, track changes needs to be on before starting the review, otherwise, the first thing the script will do is enable track changes, which defeats the purpose of the script.

3. A limitation of the script is that if a change is made to a segment that had been previously confirmed and contained tracked changes, when confirming the segment again, the new edits won't propagate to repeated segments and won't be committed to the TM because Track Changes is off prior to confirming the segment. An error message will be displayed saying that reviewed content cannot be edited when review mode is off. To solve this, the script can be suspended while the segment in question is confirmed, then activated again by using the Windows Key+S shortcut as a toggle.

I hope you will find this useful!

Note: Edited 01-11-2017 to add warning #3 and update the script accordingly.

Wednesday, November 9, 2016

Adding Terms to a Secondary Termbase Using an AutoHotkey Script

A few months ago I wrote about using Dragon to add terms to a secondary termbase. While this is great for Dragon users, it doesn't help those who either don't use Dragon or want to use their keyboard to accomplish this. Luckily, there's a great tool to automate practically any task one can think of: AutoHotkey.

So, below is a very simple AutoHotkey script to help achieve something that's not currently possible in SDL Trados Studio: adding a term to a secondary termbase while we work.

If you don't have it yet, you will first need to download AutoHotkey and install it.

To get started quickly, you will also want to download my Add Term to Secondary Termbase script. The script is an ahk file that must be saved where you can find it later. Please note that I've only recently started learning about AutoHotkey, so I'm aware that this is not the most sophisticated or elegant solution to this problem, but it works for me, so I thought I'd share it in case others find it useful.

A general note about ahk files: AutoHotkey files can be easily inspected and edited by opening them in a text editor. I like Notepad++. To make the script active, once AutoHotkey has been installed, all you need to do is double-click the ahk file. To disable the script, go to the system tray and locate the green icon with a white H, right-click and select Exit. You can have several scripts active at once. Hovering over each of the green icons will display a tooltip indicating the name of the appropriate script/ahk file.

What this script does
This script launches a series of steps that one would perform manually to add a term to a termbase that is open in MultiTerm. Note that this works in the Flags layout in MultiTerm. Other layouts (such as the Default layout that will be available with MultiTerm 2017), may require a different sequence of steps.

Hotkey
The hotkey used to deploy this script from within Studio is F12. This is just a personal preference. Please note that activating the script means that F12 will no longer do whatever it does now in Studio, so if you're using F12 for something else, you can change the hotkey to one that won't create any conflicts. To do that, you simply open the ahk file in a text editor, replace F12:: with your own preferred hotkey, for example F9:: (the two colons designate the hotkey in AutoHotkey), save the file and double-click on it again to activate the changes.

These are the steps that are launched after pressing the hotkey:

1. The selected text is copied to the clipboard.
    Note: The source term should be selected prior to hitting the hotkey.

2. Focus is changed from Studio to MultiTerm.
    For this to work, MultiTerm must be open, with the appropriate termbase where terms are to be added open as well.

3. The cursor is placed in the source field.

4. The contents of the clipboard are pasted into the source field.

5. The cursor is placed in the target field.

At this point, the target term must be entered manually. After you've finished typing in the target term, hit F12 again, and the following will happen:

6. The entry will be saved to the termbase

7. Focus will be returned to Studio

8. The cursor will be placed in the target column of the Studio Editor

Dissecting the script
This is the content of the script, with a brief explanation of each line.


So, to summarize what you need to do to start adding terms to a secondary termbase as you work in Studio:

1. Open Multiterm and open your secondary termbase
2. From within Studio, when you want to add a new term to your secondary termbase, select the source term and press F12
3. When the cursor appears in the target field in Multiterm, enter your target term.
4. Press F12

And here's a short video demonstrating the process:



Final words
Like I said earlier, I only know the bare minimum about AutoHotkey, although seeing its potential, I plan to keep learning. If you'd also like to learn more, the AutoHotkey website is a great resource, and I can't recommend these two blogs enough for specific use cases relevant to translators:

Multifarious: Paul Filkin has two great posts about AutoHotkey that can help us get started with the tool. 

Gonduana: If you read Spanish, Jesús Prieto's series of posts about AutoHotkey are both enjoyable to read and very educational.

So there you have it, a not-so-elegant but working solution to our little problem. I hope you find it useful!

Update
Thanks to Jesús Prieto's suggestions, there is now a Version 2 of the script, which you can download here. With this new and improved script you can now also copy the target term to the clipboard. After doing that, focus changes to MultiTerm, where both terms are entered into the appropriate fields, the entry is saved and focus is returned to Studio.

To use this new script, load it by double clicking on the file and then:

1. In Studio, select your source term, then press F12. A message will pop-up asking you to select the target term.

2. Select the target term.

3. Click OK to close the message box. A new message box will pop up displaying the source and target terms, click OK (or press Enter).

After doing this, the script will switch focus to MultiTerm, where your secondary termbase must be open, paste the terms in the appropriate fields and save the entry, all without any user intervention. Focus will then be returned to Studio.

See it in action here:












Saturday, April 30, 2016

Adding Terms to a Secondary Studio Termbase Using Dragon Commands

I have always wanted to be able to add terms to a secondary termbase while I'm working in Studio. As we all know, this is not possible out of the box, but with a Dragon script, it is now as easy as saying "Add term to secondary termbase".

Required software: Dragon NaturallySpeaking Professional 13, or DNS 13 Premium + KnowBrainer 2016, or Dragon Professional Individual 14, Studio and Multiterm

* For a very basic intro to creating commands, you may want to read this first.

I've created two scripts for this: one that pastes the source term into Multiterm, where the user will have to type or dictate the target term next, and another one that automatically populates the dictated target term, sort of like Add New Term and Quick Add New Term features in Studio, except that the terms will be added to whatever termbase is open and active in Multiterm.

Step 1: Create your commands in Dragon or KnowBrainer

Feel free to copy and paste the scripts below.

Script 1: Add selected source term to secondary termbase
Example of what you say: "Add term to secondary termbase"; this is the command name and must be spoken exactly as entered in the script. You can choose your own command name.

Command name: Add term to secondary termbase (adapt to whatever you prefer)
Description: Adds the selected source term to a secondary termbase (opens Multiterm) - not open-ended

Sub Main
SendKeys "^c"
Wait 1
AppBringUp "C:\Program Files (x86)\SDL\SDL MultiTerm\MultiTerm12\MultiTerm.exe"
Wait 1
SendKeys "{F3}{Tab}"
Wait .2
SendKeys "{Tab}^v"
Wait .5
SendKeys "{Tab}"
End Sub

The above script is shown in the KnowBrainer Command Editor window


Script 2: Add selected source term and dictated target term to secondary termbase
Example of what you say: "Add term worker", where "worker" is the target term that will be added to the Multiterm entry

Command name: Add term <dictation> (if you haven't, please read the section about open-ended commands here)
Description: Adds the selected source term to a secondary termbase, inserts the dictated term into the target field, and saves the entry

Sub Main
SendKeys "^c"
Wait 1
AppBringUp "C:\Program Files (x86)\SDL\SDL MultiTerm\MultiTerm12\MultiTerm.exe"
Wait 1
SendKeys "{F3}{Tab}"
Wait .2
SendKeys "{Tab}^v"
Wait .5
SendKeys "{Tab}"
Wait .5
SendKeys ListVar1
Wait .2
SendKeys "{Enter}"
SendKeys "{F12}"
End Sub

The above script is shown in the KnowBrainer Command Editor window

Using your commands
Before running your commands, open your secondary termbase in Multiterm.  If the termbase is added to you current Studio project, you will have access to the terms you add as you translate. You can minimize Multiterm after doing this.


That's all you need to do. If you're using KnowBrainer, you will see the new commands in the Sidebar, ready to be used. KnowBrainer helpfully lists the commands available for the active program in its sidebar, and highlights the recognized commands as they are used.



And to finish, here are the commands in action!