Tuesday, August 10, 2010

AHK script for translating MemoQ segment with GT4T

Here is a script written in AHK for translating entire segments in  MemoQ with the help of Google Translate by means of the program GT4T (http://gt4t.net/gt4t_en/). The script assumes that you have mapped the key combination ALT+J to translate the selected words in GT4T, but of course this could be changed accordingly. Just press ALT+X and the segment will be translated via Google Translate.

; Memoq
 SendMode Input
 Send ^+s
 Sleep, 150
 Send ^a
 Sleep, 150
 Send !j

Sunday, August 8, 2010

Translating SDL Trados projects in memoQ

SDL Trados is one of the more popular translation tools besides memoQ. memoQ provides interoperability with SDL Trados 2007 and SDL Trados Studio 2009.Using memoQ you can accept jobs in SDL Trados Tageditor’s TTX format or SDL Trados Translator’s Workbench’s bilingual DOC/RTF format. SDL Trados 2007 does not accept all segmentation and can crash on files segmented by other translation tools, therefore prior to opening a file it is advised to pre-segment the file using a demo or paid-up version of SDL Trados 2007. You can do this by opening Translator’s Workbench, creating or opening an empty translation memory, clicking Tools/Translate and enabling the Segment unknown sentences checkbox, then running a pre-translation. If you don’t pre-segment the files, memoQ will import an empty file by default. You can click Add document as and select Import unsegmented content, however, be careful with this - we cannot guarantee that SDL Trados will accept the file translated this way. Thousands of translators and companies are using memoQ to process SDL Trados jobs. Many language service providers are using the memoQ server to add teamwork capabilities while translating SDL Trados jobs. This is a reliable solution.
Translation memories from SDL Trados can be imported in TMX format. If you use TMX 1.4b, and your translation memories come from a tagged document such as HTML or XML, memoQ will also perform a tag conversion which goes beyond what’s described in the standard. This tag conversion is specifically targeted at converting SDL Trados tags into memoQ tags.
memoQ, just like SDL Trados Studio 2009, supports XLIFF as a bilingual format, and the two systems are interoperable through XLIFF. You cannot export a memoQ file in SDL Trados Studio 2009 into the underlying format such as Microsoft Word, and you cannot export an SDLXLIFF file in memoQ into Microsoft Word either.
In a server scenario you cannot expect memoQ to connect to an SDL Trados server. Server technologies are, unfortunately, not interoperable. This is, however, a rare scenario and most translation companies are not expected to translate online.
memoQ-prepared projects can also be processed by SDL Trados 2007 and SDL Trados Studio 2009 through XLIFF. Source: kilgray.com

memoQ and bilingual DOC

Unclean, shmunclean, Add document, Import/update bilingual – read the whole story behind memoQ’s support for bilingual DOC files.
If you’re confused and not sure which command to use when working with bilingual RTF/DOC files, you are probably not alone. In this post we explain how memoQ supports this file format.
We designed this feature with interoperability in mind. There are two distinct scenarios that memoQ supports.
Scenario 1: A memoQ-based workflow where a third-party tool is used to translate or proofread a document, but the original file is imported into a memoQ project.  This workflow is made up of the following steps:
  1. Import any document into a memoQ project.
  2. Select the document, click Export bilingual, and select TRADOS-compatible bilingual DOC. In the options, make sure Simple formatting is checked.
  3. Edit the document in Word or any CAT tool that supports the bilingual DOC format.
  4. Back in memoQ, use Import/update bilingual to update the document in your project. memoQ will recognize that the file is identical to a document in your project, and update that document’s target segments with what it finds in the DOC file.
Caveat: When editing the file outside memoQ, be very, very careful not to overwrite any hidden text. If you unintentionally delete even a single purple character in the bilingual DOC file, memoQ will not be able to update the document in your project.
Good to know: When you update your project using a from DOC, memoQ recognizes which target segments were edited in the file. These rows will always become “Edited” in your project, which gives you an easy way to quickly review changes.
Scenario 2: A Trados or Wordfast-based workflow where memoQ is used to receive and deliver a job in the other tool’s format.
  1. Make sure you start with an “unclean” file, i.e., a document that has been pre-translated in Trados or Wordfast.
  2. Simply use Add document to import the document into your memoQ project.
  3. To export an “unclean” file that contains both the source (as hidden text) and your translations, use Export bilingual. Choose TRADOS-compatible bilingual DOC, and make sure Simple formatting is not checked.
  4. To export a “clean” Word document with only the translated text, use Export (dialog) or Export (stored path).
Good to know: If you are translating a Word DOC with very simple formatting, you can also import it in Step 1 above if it is not pre-segmented by Trados or Wordfast. However, in this case there is a high probability that the result will not be Trados-compatible, i.e., Trados will not be able to process the unclean export you get in Step 3. Source: kilgray.com

Saturday, August 7, 2010

How to connect to SkyDrive with WebDAV

Actually, I stumbled upon this when I decided to try out Office 2010 beta. I haven’t found any official documentation about how to connect to Windows Live SkyDrive with WebDAV (or any API), so I’m not sure how well supported this will be in the future. If you find any word about this from Microsoft, please let me know in the comments. The good news is that it works. The bad news is that it is very slow, but being 25 GB for free I guess you get what you pay for speed-wise (understandably).
[Update: New info about a tool I wrote to find out the addresses for WebDAV discussed below]
There is now a tool available that can determine the addresses you need for your WebDAV access to SkyDrive. It is available on CodePlex here. You can download the console application and run it from a command line. There is also a WPF application (seen below) if you have the latest version of .NET 3.5 SP1. More info in CodePlex site. But read the background below to know how I got there and what to do with the information that the tool provides.
Showing how to determine WebDAV address with WPF application
But let me start at the beginning with a brief introduction to Office 2010 beta. If you find this boring, scroll down to here.

Microsoft Office 2010 and installing the beta

I had actually decided to part from Microsoft Office in favor of more lightweight applications like Google Docs and OpenOffice. For two reasons: price and size. So I haven’t installed Office 2007 on any of my newer computers or laptops for the last six months or so in order to ensure that I don’t need it anymore and I have gotten by pretty well.
The application I’ve missed the most is probably Outlook. At the same time it is the application where the hate/love relationship is the greatest. I really like working with it but at the same time it feels way too big, bulky and complex for something that should be simple: mail and calendar (the way I see it). Too much MAPI baggage I think.
Then I listened to Windows Weekly with Paul Thurrott about a new installation option for Office 2010 beta. It is called Click-To-Run and sounded interesting since it uses an application virtualization technology called App-V that means that you can install and run the application side by side with whatever you have on your computer without risking changing any system settings (which especially affects Outlook, had I had Outlook 2007 installed).
I decided to give Office 2010 an extra chance and now I’m glad I did. Not only for discovering WebDAV access to SkyDrive. Everyone can download, install and use Office 2010 beta until october 2010 when it expires, but you do need a Windows Live ID.
Of course, there are a hundred-and-one SKUs (different packing of included applications etc) to choose from for Office 2010 also. No, I shouldn’t be so sarcastic about that since it does mean that if you don’t need everything in the full suite you will be able to get it for a lower price. But it is a pain to keep track of all the combinations.
What I’m getting to is that Click-To-Run only seems to be available for the “Home and Business” SKU, at least during the beta period. So go and download and install it here (requires registration via a Windows Live ID). The installation experience was smooth but a little weird. You see, Click-To-Run also has some sort of streaming built in so that different parts are downloaded when needed. In practice this meant that it looked as though only PowerPoint was installing since that was the screen shown during most of the installation. But I realized that was because an introductory PPT-file is automatically shown as the first thing after installation. Also, beware that one (or two?) dialogs didn’t activate as the topmost window and therefore I missed answering them (which is why the installation seemed to be stuck for a while).
One great thing about configuring Outlook 2010 that really impressed me was that I only had to specify my e-mail address for Outlook to figure out on which server my mail was located and by which access method it could connect. Maybe I shouldn’t be impressed since it usually is that easy for ordinary POP3/IMAP access, but still – a great improvement that has awakened my interest in Microsoft Office.
Another thing I like already is that the big circle button in the top left corner of the window is gone and has been replaced by a File tab (albeit a “special” tab) . That makes the interface much more uniform – a strip of tabs – and maybe even I can find the ribbon likable…

Microsoft Office 2010 and the web

The first thing that interested me, and that led to the discovery of WebDAV for SkyDrive was “Save to SkyDrive”. Yes I know – get to the point!! – not yet…
Paul Thurrott mentioned this feature in the netcast and it was the first thing I tried. Under the File tab and the Share menu option you’ll find “Save to SkyDrive”. Of course, I assume you already have a SkyDrive account so just login and you will be presented with your folders.
Office 2010 and Save to SkyDrive option
The next step in this screen dump is to double click the Public folder. Note however that this is really slow (for me, at least) and that Excel is unresponsive for a minute or two. Lets hope we can attribute this to beta software. Have patience, and you will (hopefully) be prompted with a dialog box to specify the file name, which is also what gave the WebDAV functionality away.
Dialog box asking for a file name
Also, before this dialog box appeared, the status bar gave away an address. I have removed the part that is unique to every user below (a guid), and changed it in the screen dump above.
Status bar in Office specifying the address
Nice! My conclusion was that Office 2010 must be using WebDAV for this so I had to investigate this further.
Another surprise was that SkyDrive in the browser will obviously support Office Web Applications, which means that you can view and even edit the documents right there in your favorite browser (which is Firefox, of course). At the moment, you can only view Word documents, but you can actually edit Excel spreadsheets. Excel editing looks really nice and is really hard to separate from the real application visually, however it does not seem to have a lot of functionality. I couldn’t find copy-down for instance. It remains to be seen just how much functionality will be available, but it would be strange if Microsoft didn’t try to at least match Google Docs Spreadsheets.

Steps to access SkyDrive folders with WebDAV in Windows Explorer

So, with this new information, here are the steps to connect to SkyDrive folders using WebDAV and get access to their contents in Windows Explorer. Note that I’m using Windows 7 (64-bit) and I don’t know if this works in older Windows versions.
[Update: I first thought that you could access SkyDrive folders without the sub domain mentioned above. That is probably not the case, so I've revised my instructions.]

In order to determine what path to specify in Windows when connecting via WebDAV, you either need to run my tool or use Office 2010. If using Office 2010, create a document and share it to SkyDrive as described above. When saving the document and specifying its file name, you have the chance to look at the address bar and copy the path, in my example:
Actually, the folder name “b8c6f2e973a17512″ in the path is the same as a personal sub domain when logging on to SkyDrive the normal way from your web browser. It can look like “http://cid-b8c6f2e973a17512.skydrive.live.com/”.
The sub domain “pxeptc” in my example is something derived from your SkyDrive account and the specific SkyDrive folder you want to access via WebDAV. So for every folder in SkyDrive that you want to access via WebDAV, you have to share a document from inside Office 2010 to determine this name.
In developing my tool, I saw that Office calls a web service to determine the WebDAV addresses for each folder in your SkyDrive account. That web service is located at http://docs.live.net/SkyDocsService.svc but you can’t access it in your browser since it requires a Live ID authentication token. (My tool fixes that.)
Also, some folders are special and “known” to the system much like “My Documents” on your computer. That means that their name is not the same as on the web page in SkyDrive. I have identified two such folders that I have. In SkyDrive they are called “Public” and “My Documents”, but in WebDAV they are called “^2Public” and “^2Documents”.
Also note that Windows recognize another way to specify this address which I think is interpreted in the same way. So the following two addresses would be equivalent:
To increase speed you should also make sure the following option is unchecked in Windows (if you don’t need it):
Control Panel, Internet Options, Connections, LAN Settings, Automatically detect settings


That’s it! Of course the maximum size of a single file is still enforced (I just had to try…). Unfortunately I don’t think this will work in other operating systems. I assume that the WebDAV part is used according to the standard, so that should not be a problem. However, I did notice when looking closer at the http communication that the server wants to authenticate with Passport1.4 (MS-PASS) which is Microsoft specific and I doubt that would work on Mac or Linux?
Also, it is very slow. Sure, you get what you pay for, but maybe there will be more (payment) options with SkyDrive in the future now that the sharing functionality from Office 2010 has been implemented. I don’t think I would mind paying if the speed was there.
I suspect Microsoft has something up their sleeve when it comes to “storage drives in the cloud” (duh! :) ). Right now they have been silent for quite some time. I use another service, namely Live Mesh, for file synchronization. It works great (5 GB limit), but it has been in beta for long now and Microsoft has discontinued all the developer stuff (sdks) for that service and for all or most of Live Services also I think. They are obviously up to something.
Unfortunately, there is no caching of files accessed over WebDAV. Windows has a built in system for remote access of files on remote locations called “Offline files”, but it only works on true Windows paths (SMB) and not WebDAV. At least not that I know of. Therefore you probably want to save to local disk and use a synchronization application to put your files on SkyDrive.
For me as a developer the most important part of this story is that there now is an api for SkyDrive access where there was none previously. Not counting the screenscraping way of the SkyDrive client library by ghollosy on Codeplex. It worked great when I tried it, but I don’t like to be in the hands of the web browser user interface on the site in case that changes (more of a “when”, than “if”?).

Additional information about photos

In my SkyDrive account I also have photos. They are obviously not exactly the same thing as a folder. I think they are somehow integreated with Windows Live Photos or whatever the branding is. Maybe you can have Windows Live Photos in your Windows Live account without having a SkyDrive folder account?
Anyway, I also discovered that this WebDAV access works with photos but I haven’t found a way to determine the sub domain needed for all my photo folders. However, if you have the name of a photo folder, I got Windows Explorer to do a redirect and tell me the name.
I just followed the pattern above and replaced the last part such as “^2Documents” with the exact name of one of my photo folders. And what do you know? Windows Explorer took a few seconds but then redirected to a sub domain under docs.live.net and there were all my photos in that folder!

How to set up WebDAV in Windows Explorer

If you need more specifics about how to create the WebDAV connection in Windows Explorer, here are the screendumps.
First, right-click on Network icon in Windows Explorer and select “Map network drive…”.
Select Map Network Drive in Windows Explorer
This dialog box will be shown:
Click on link
[Update: I previously had several screen dumps here, going through the whole wizard, but I later found out that as long as you map a drive letter at the same time, you can do it all from this single dialog box.]
Type in the path to the SkyDrive folder that you want access to in the “Folder” field. You can use either the https path or the \\ path. For instance:
Dialog box with filled in path
Windows will ask for your SkyDrive login either way, but you should also check the option “Connect using different credentials”. You don’t have to check “Reconnect at logon” of course, but then you have to remember the path the next time you need access. It may be a bit irritating to have the SkyDrive mapped on every boot since Windows probably will complain that it could not attach the mapped drive (if you don’t store the password permanently).
Click Finish and after typing your SkyDrive user name and password you are done.
Dialog box asking for user name and password
Showing the new drive in Explorer left pane
Remember that file access to a remote location using WebDAV probably is a lot slower than local file access in all cases, and especially slow on SkyDrive. Don’t be surprised if your waiting time increases when saving files etc. Source: http://www.mikeplate.com