Since Studio 2014 was launched it’s been interesting to see what some users were waiting for. Did they want the Quickmerge, Alignment, AutoSave, improved navigation, blistering speed, automatic concordance search, improved filters, enhanced locking functionality, custom TM user ID, improvements to the term recognition threshold, more options in the display filter, auto-substitution for acronyms and a host of other improvements? No… and I genuinely don’t mean this in a mean way… it seems for some users an easier way to handle typographical quotes is the order of the day and this hasn’t radically changed since TagEditor.
I’m sure I don’t have to go into detail on what these are, but basically when you type into a segment and use quotation marks your computer is probably going to use straight quotes like this, often referred to as “dumb” quotes:
When what’s normally preferred is this, often referred to as “smart’ quotes:
So how do you handle these in Studio? I thought it was worth a quick article to show you how using three different methods:
- Search & Replace
Let’s start with QuickInserts.
Studio has the concept of QuickInserts which are a mechanism for being able to add characters, text, symbols or tags into your translation as you work as placeables or tag pairs. You can read more on these in the product help here:
The basic idea is that you have a button on the toolbar that when clicked, or when you use a keyboard shortcut for it, will insert the items you wish. Each filetype requires it’s own QuickInserts because not all filetypes support the same type of things you may add in there. For example, you may decide to add tags that represent the code to control something in an XML file and this may cause a problem if you used this in an IDML or another type of XML document for example.
In addition, some filetypes already come with some QuickInserts built in. So if I look at a QuickInsert Group for a Word file I see this:
So this already has QuickInserts for two types of quotes built in and the one I’m hovering over is the smart quotes. Note that there is a keyboard shortcut for this as well, Ctrl+Shift+6.
If I open an IDML or XML file for example then you’ll find that these smart quotes are not there. So you would have to add them. To do this you open the Filetypes Options, choose the appropriate filetype and then QuickInsert. In this image below you can see where I have already added one for the smart quotes:
The editing window for this is very simple and looks like this, where the only choice you really have is to decide whether you want this to be a placeable or a tag pair and whether you want it on the toolbar or not. I’ve chosen a tag pair which means I can insert both quotes together and type my text between as I translate… or I can highlight the word and then press the QuickInsert to have the smart quotes added either side of the highlighted word:
Once I’ve added it my QuickInsert Group for an IDML file looks like this:
The important thing to note here is that I once again have a keyboard shortcut, but note that it’s now different to the one I have for Word… this time it’s Ctrl+Shift+4. So this means I’d have to either remember different shortcuts for each filetype, or use the mouse.
So using QuickInserts for something that you may have to use a lot in different filetypes may not be the most attractive option. If you work mainly in one or two formats then it could be the easiest method for you.
One other important point to note about using QuickInserts is that if the file has been prepared for you already, so you receive the SDLXLIFF or a Project package, and the person who prepared the file for you did not add smart quotes to their filetype before preparing the work then you will have to add them again in Project Settings even if you already have them in your own filetypes.
Search & Replace
This solution, whilst a little geeky, has its merits. If you receive a bilingual SDLXLIFF file, or Studio package that has already been translated and you are asked to review it then you may have to deal with the situation where dumb quotes have been used instead of smart quotes. In this case it may be easier to search and replace the quotes in one go rather than painfully replace them all one at a time.
Using a text based search and replace this would not be possible because the opening and closing quotes are different… or at least you’d have to do two runs. One to find a space followed by a dumb quote and then replace this with a space followed by an opening quote. Then you search for a dumb quote followed by a space or some other punctuation and replace it with a closing quote.
But a more elegant solution is to use regular expressions. So you can search for this:
And then replace with this:
The expression itself is not too complicated. The search looks for a space followed by a dumb quote and stores the space in a the first back reference. Then it does a “lazy” search for anything apart from a line break until it reaches the closing dumb quote and stores what it finds (the words between the quotes) in the second back reference.
The replace recalls the first back reference and adds the opening smart quote. Then recalls the second back reference and adds the closing smart quote.
But you can check out this article for an explanation of how you use search and replace regular expressions in Studio:
This is actually my personal favourite solution to this issue. I like this best of all because this allows me to use typographical quotes wherever I am writing, and not just in Word or Studio. You may have read this article I wrote called AutoCorrect… for everything! which explains how to use AutoHotkey so you can have your Word autocorrect lists available for you in Studio, or anywhere else. If you did, and if you implemented it, then you’re half way there already.
All you need to do is add a couple of lines to the script you already have:
;---------------------------------------------------- ; Replace dumb quotes with smart quotes as you type. ;---------------------------------------------------- :*?:" :: Send ”%A_Space% Return :*?: ":: “
This is a simple script that uses regex to simply replace a dumb quote before a space with the closing smart quote, and a dumb quote after a space with an opening smart quote as you type. So it’s a little like the autocorrect in Word except it works everywhere. I thought a short video would be useful here so you can see how this works in practice as it may encourage you to have a go… and I showed all three methods in a couple of minutes.
So I really like this solution because it’s yet another place where you can see how useful learning a little about regular expressions can be, and because it provides a solution to the dumb smart quote issue that can be used in any application that supports typographical quotes!
So I hope this is a useful article for anyone wondering how to deal with smart quotes in Studio or anywhere else.