Welcome / Bienvenue / Benvinguts / Bienvenidos
For information about my translation services, please visit the main site.
Pour des informations sur mes services, merci de regarder le site principal.
Para información sobre mis servicios de traducción, visite el web principal.

Macro to prepare documents for monolingual review in memoQ (and possibly other CAT tools)

MemoQ’s monolingual review feature works best with clean Word documents containing no tracked changes or comments. If you import a document in which changes are still visible or in which there are comments, memoQ will add lots of code to the target text, which you don’t want.

This macro cleans the document up and saves it under a new filename (so that you don’t overwrite the commented version), making it ready to be imported as a monolingual review.

The macro includes comments to explain what some of the lines are doing and how you can adjust the macro to meet your needs.

Since many translators use only straight apostrophes and quotation marks in memoQ, then convert them to the curly variety in the final document sent to the client, the macro includes an optional line (deactivated by default) that will revert all apostrophes and quotation marks to the straight variety. Please read the instructions carefully if you wish to use that line.

Thanks to Kevin Mote, who provided the code for the part of the macro that renames the file. My code is a slightly modified version of his. In particular, unlike Kevin’s version, mine does not overwrite the old version, since most translators would want to keep a copy of the commented version they sent to their client.


Sub PrepareForMemoQMonolingualReview()
' memoQ's monolingual review feature works best when you import a document with no tracked changes and no comments.
' This macro removes them, then resaves the file with "clean-for-import" appended to the file name.
' The part that appends the filename is adapted from the macro provided by Kevin Mote (https://www.linkedin.com/in/kevinmote/) at https://superuser.com/a/781501. Thank you Kevin. This was very helpful!
' Please note that, unlike Kevin's macro, this version does not delete the original file.
Dim strFileFullName, strFileName, strNewName, strFileExtension As String
'
ActiveDocument.AcceptAllRevisions ' Accepts all tracked changes
ActiveDocument.TrackRevisions = False ' Switches off track changes
ActiveDocument.DeleteAllComments ' Deletes all comments in the active document.

ReplaceQuotes ' Reverts quotation marks and apostrophes back to the straight variety, assuming that this is the variety that was used while working in the CAT tool.
' Remove the apostrophe from the above line if you want the monolingual review document to revert to straight apostrophes and quotation marks.
' Note that to run the above line you also need to have installed the "ReplaceQuotes" and "QuotesReplacementBothWays" macros, which I provided along with several others in a blog post at http://www.anglopremier.com/blog/?p=1119.
' *****ADDITIONAL OPTION DESCRIBED ABOVE*****

' Get current name:
strFileFullName = ActiveDocument.FullName 'for Word docs
'strFileFullName = ActiveWorkbook.FullName 'Use this line instead for for Excel docs
'strFileFullName = Application.ActivePresentation.FullName 'Use this line instead for Powerpoint presentations
If (InStr(strFileFullName, ".") = 0) Then ' Checks whether the full file name contains a file extension by looking for a dot.
res = MsgBox("File has not been saved. Can't rename it.", , "Rename File")
Exit Sub
End If
' strFileName = Right(strFileFullName, Len(strFileFullName) - InStrRev(strFileFullName, "\")) 'strip path - not used. Next line used instead.
strFileName = strFileFullName
strFileExtension = Right(strFileName, Len(strFileName) - InStrRev(strFileName, ".")) ' Identifies the file extension
strFileName = Left(strFileName, (InStr(strFileName, ".") - 1)) ' Strips the extension from the strFileName variable
' If InStr(3, strFileName, "_Delivery", 1) <> 0 Then strFileName = Left(strFileName, (InStr(strFileName, "_Delivery", 1) - 1))
' The above line is not used. Originally intended to strip the word "_Delivery" and the delivery number from the file name (assumes "Delivery" is at least the third character; not case-sensitive). But I dedcided I wanted to keep the delivery number.
' If you wish to remove something from the file name you can reinstate the above line (remove the apostrophe) and replace "_Delivery" with whatever you want to remove.

' Prompt for new name. Replace "_clean-for-import" on the next line if you prefer something else to be appended by default.
strNewName = InputBox("Rename this file to:", "Rename File", strFileName & "_clean-for-import." & strFileExtension) 'Saves with the new name. Extension is not changed.
If (strNewName = "") Or (strNewName = strFileName) Then ' (Check whether user cancelled)
Exit Sub
End If

' Save file with new name:
ActiveDocument.SaveAs2 FileName:=strNewName 'for Word docs
'ActiveWorkbook.SaveAs2 FileName:=strNewName 'for Excel docs
'Application.ActivePresentation.SaveAs FileName:=strNewName 'for Powerpoint presentations

End Sub

Share:

AutoHotkey script to move the focus away from the Concordance window

Sometimes you want to keep the MemoQ Concordance window open on your second screen while you work on your document. But there’s no built-in method to achieve this with the keyboard. You can only do so by clicking with the mouse.

This short script moves the focus away from the Concordance window and to the main MemoQ window, allowing you to work on the document while keeping the Concordance window open. Just press ctrl+k to activate the script.


#IfWinActive, Concordance
^k:: ; MemoQ: Move focus away from Concordance window
WinActivate memoQ
#IfWinActive
return

The following script closes the Concordance window. Continue reading

Share:

Useful links related to PerfectIt

PerfectIt checks: A brief explanation of each check performed by PerfectIt, with links to a full explanation.

PerfectIt style sheets: Information on working with style sheets and customising them.

PerfectIt settings tab: What the options in the Settings tab do and how to configure them.

Introduction to MS Word wildcards: An exercise providing a basic introduction to using wildcards in Microsoft Word. Includes links to other, more comprehensive resources on Word wildcards.

Users’ Facebook group: A Facebook group for PerfectIt users. Users ask how to configure certain settings. Particularly useful if you can’t get a wildcard search working.

Associations offering discounts: a list of associations whose members are entitled to a discount on PerfectIt.

Interested in a workshop?

I organise PerfectIt workshops for translators’ and editors’ associations in which I provide an overview of the program, then delve into its advanced features. I usually end with an interactive section in which participants can ask me how to enforce certain style rules using PerfectIt. For more information, write to the e-mail address found on my main website.

If you have already attended one of my workshops and have not received How-to…with-PerfectIt4.pdf, send me an e-mail and I’ll send you a copy.

IntelligentEditing’s playlist on building stylesheets

Share:

La facturation en monnaie étrangère : un formulaire pour convertir les prix en euros selon la loi française

La loi française permet la facturation en monnaie étrangère, et le portail de l’Économie, des Finances, de l’Action et des Comptes publics explique comment le faire.

Pour le calcul du montant en euros de vos factures, j’ai créé un formulaire Excel. Il suffit d’introduire la date de facture, le montant et la devise pour que le formulaire vous calcule le montant en euros selon les deux méthodes permis par la loi française. Les taux de changes utilisés pour les conversions sont les taux officiaux de la Banque centrale européenne, qui publie les taux de référence utilisés par les autorités françaises.

ConversionFacturesDevises par anglopremier.com.

Share:

How to remove an initial cap from glossary entries

Many online glossaries start every term with a capital letter, such as in this example:

  • Comptes d’accumulation
  • Accumulation accounts

Since these terms would only be capped at the start of a sentence, translators ought to import them without the initial caps.

Use the following formula in Excel to remove leading caps. The formula below assumes the first term is in cell E1, but to change it to wherever your first term is, then paste it down all the rows containing terms.

=IF(EXACT(UPPER(MID(E1,2,1)),MID(E1,2,1))=TRUE,E1,LOWER(LEFT(E1,1))&RIGHT(E1,LEN(E1)-1))

Please note that if you don’t use Excel in English, you will need to translate the formula words. Also, if you have your system set to use decimal commas, replace the commas in the formula with semi-colons.

The reason the formula is so long is because it initially checks to see whether the second character is capped. If the second character is also capped, it assumes the term is an acronym, and therefore does not change the first character to lower case.

Share:

Macro to replace smart quotes and smart apostrophes with straight quotes and straight apostrophes in Word

UPDATE: I no longer recommend this macro because it does not look at footnotes and text boxes. Instead, you should use the macro available here.

Many users of CAT tools like to convert smart quotes and apostrophes to straight ones before translating their documents, because if the straight versions are always used, it means concordance searches for words including apostrophes will always work.

The problem is that it takes quite a while to do this in MS Word. You can’t just find/replace the apostrophes, because even if you put a straight apostrophe in the replace box, Word will interpret it as a smart apostrophe if you have set Word up to use straight apostrophes and quotes.

Of course, you could change that setting, but then it is more complicated to convert the straight varieties to the smart varieties after exporting from your CAT tool.

The solution is to use a macro that will automatically switch smart quotes and apostrophes off, then perform the search, then switch them back on.

Here’s a macro that will do just that.

Option Explicit
Sub ReplaceQuotes()
' ReplaceQuotes Macro, by Timothy Barton, Anglo Premier Translations
'
Application.Options.AutoFormatAsYouTypeReplaceQuotes = False
Selection.find.ClearFormatting
Selection.find.Replacement.ClearFormatting

With Selection.find
.Text = ChrW(8220)
.Replacement.Text = """"

.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False

End With
Selection.find.Execute Replace:=wdReplaceAll

Selection.find.ClearFormatting
Selection.find.Replacement.ClearFormatting
With Selection.find
.Text = ChrW(8221)
.Replacement.Text = """"

End With
Selection.find.Execute Replace:=wdReplaceAll

Selection.find.ClearFormatting
Selection.find.Replacement.ClearFormatting
With Selection.find
.Text = "´"
.Replacement.Text = "'"

.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False

End With
Selection.find.Execute Replace:=wdReplaceAll

Selection.find.ClearFormatting
Selection.find.Replacement.ClearFormatting
With Selection.find
.Text = "‘"
.Replacement.Text = "'"

.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False

End With
Selection.find.Execute Replace:=wdReplaceAll

Selection.find.ClearFormatting
Selection.find.Replacement.ClearFormatting
With Selection.find
.Text = "’"
.Replacement.Text = "'"

.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.find.Execute Replace:=wdReplaceAll
Application.Options.AutoFormatAsYouTypeReplaceQuotes = True

Dim oShell As Object
Dim iResponse As Integer
Set oShell = CreateObject("Wscript.Shell")

iResponse = MsgBox("Procedure complete. Code provided by Timothy Barton, Anglo Premier Translations. Would you like to visit the website?", _
vbYesNo, "Procedure complete")

If iResponse = vbYes Then
oShell.Run ("http://www.anglopremier.com?utm_campaign=apostrophesmacro&utm_medium=referral&utm_source=blog")
Else
Exit Sub
End If

End Sub

Share:

Use old-style Excel and Word menus in new versions of Office

A common complaint people make when they install Word 2007 (or Excel 2007) or later is that they don’t like the ribbon and prefer the menus used in Word 2003 (or Excel 2003) and earlier. Microsoft insist that things are easier to find in the new version, but many of us beg to differ. For me, my main qualm with the new version is that it takes me longer to browse through all the options than it did with the old system.

Also, certain options are in illogical places. For example, if you want to insert a row or column in Excel you’ll probably look in the “Insert” tab. But you won’t find it. It’s in the “Home” tab. Why on earth is an “insert” option not in the “Insert” tab?

The Swiss company UBit has produced an add-on that creates a ribbon tab called “Menu”, which contains old-style menus. The add-on can be downloaded from here.

Unfortunately it doesn’t allow you to open the menus with the keyboard. And that’s where I come in! I’ve produced a script to be used with UBitMenu that allows you to open up the menus using the keyboard (i.e. alt+f opens the file menu, etc.) and browse through with the cursor keys. Click here to download the script.

Once you have installed UBitMenu and my script, you can browse through the menus almost as easily as in the old version of Word and Excel.

Please note it currently only works with the English menu shortcuts, and it may not work with certain screen resolutions, as it relies on clicks on the correct part of the screen.

If you test it, please report back whether it works for you.

If you would like a version for your own language, please tell me the shortcut letters for the different menus (File, Edit, View, Format, Tools, Table and Window) in your language.

Share:

Bookmarklet tweaks

I’ve corrected some of the bookmarklets I made available on my main website. All the bookmarklets now lead to the correct site, and the Oxford English Dictionary one now works with all words. There is also a link to a site explaining how to disable speed dial in Firefox, since the bookmarklets don’t work if you are on the speed dial page.

Share:

Invertext glossaries

Edit on 29 March 2012

I have looked at this glossary more closely and having seen entries like this I can only conclude that it is not a reliable source.

End of edit

For professional translations, visit www.timtranslates.com.

Today I stumbled across this little beauty of a webpage. It contains a bilingual Spanish<>English glossary with 6,000 definitions in the fields of banking, stock markets, accounting, money and currencies, corporate banking, retail banking and money laundering. I’ve not really tested it yet, but it looks promising.

The glossary is produced by Ediciones Verba, who have produced what looks like a very interesting set of technical dictionaries. I’d be very interested in hearing from anyone who has bought the dictionaries.

I’m a little hesitant about buying them because I wonder whether at some point they’ll put everything online. Also, the dictionaries are not cheap (though given the number of entries, that’s not surprising). I do hope that at some point they will produce digital versions, because that’s what most translators prefer searching in. I’d rather select the terminology I’m looking for and activate a search on my computer or online than get a bulky paper dictionary and look for it manually. In fact, I’d be willing to pay more for an electronic dictionary than for a paper version.

Share: