Saturday, July 28, 2018

Memsource files in MemoQ

When it comes to online CAT-tools I personally consider Memsource as one of the better ones – it’s reasonably fast, offers decent functionality and usability. It’s even better with local (but not offline) client, which can undock some windows, so you can have concordance and TM matches on screen at the same time. Still, it’s not the same as memoQ when it comes to comfort and features, so whenever possible, I process Memsource files in memoQ – that is, if PM allows to download .mxliff files for work with local tool.

To do so I’m running pre-translation with relatively low threshold, download project files and open them in memoQ with another copy in Memsource for concordance and TB checks. After translation I open the files in memsource editor and use upload functionality to synchronize files with the server.
Unfortunately, the XLIFF format is a bit loose when it comes to how certain features should be implemented, so things like match rate and translation status are not imported by default and need some tinkering. I have created a template that can be used to import Memsource files in a bit more comfortable way.

There is a substantial edit concerning the template:

Originally .mxliff files were modified only before importing into memoQ, and I left cleaning up extra content to memsource editor. Now when you export finished translation, extra bits added for memoQ’s compatibility will be removed.
Additionally:
  1. Segments confirmed in memoQ will show as confirmed in Memsource. Of course you should still update the Memsource TM.
  2. Content of “Alt-trans” imported by default to memoQ from Memsource as comment will be ignored now. I was asked by multiple users to disable this. If you want alternative translations from Memsource, you can enable them in memoQ filter filter options.
  3. I removed my export path rules from template settings – this was causing problems for some users. Still, it’s a good idea to edit export path rules so memoQ will overwrite original files and you won’t have to manually re-name files exported from memoQ (to remove defalut “_iso” target language addition).
Original post content (still valid):
The template work by performing automated actions: the files are edited with regex-based Find and Replace rules to insert additional attributes for match rate and segment states (regex rules are included in .xml configuration files). Subsequently customixed XLIFF filter is used, configured to recognize the introduced attributes and regex-based tagging is run to convert Memsource tags into memoQ tags.
To use the template you need to follow instructions below for import and setup. When everything is configured correctly, you can create project from template and work with Memsource files more comfortably. But always remember to back up your files in case something goes wrong. Also while the conversions and template were tested by two people without any issues (at the time of publication), I can’t predict every possible case and setup, so you are doing this at your own risk – if something goes wrong, I may tray to help, but I won’t be held responsible.
Before you start: the template will work only with memoQ 8.x and 7.8, not older. However, executable file “FindAndReplace.exe” is only installed with memoQ version 8.1 and newer. If you have older version, you need to download it separately (see below).
Template Memsource does the following:
  • match rate will be visible in memoQ
  • locked status will be kept (segments locked in memsource will be locked in memoQ)
  • “translated” status will be kept
  • segments populated with machine translation will have “MT” status in memoQ
  • memsource tags will be converted into memoQ tags

Preparation:

1. memoQ version 8.1 and newer: none
2. memoQ version 7.8: download and unzip executable FindAndReplace (alternatively download and install newest memoQ version, you can still use 7.8, but FindAndReplace will be installed in the default path).

Installation:

  1. Download this file: memsource_updated.zip
  2. Unzip the content (remember where you unzipped it).
  3. Start memoQ, open Resource console.
  4. Select Filter configurations.
  5. Select Import new and import:  ChainedConverter#memsource-tagged.mqres
  6. Select Project templates.
  7. Select Import new > Memsource.mqres
    The template contains hard-coded path for configuration file: C:\memoQ\FindAndReplace\memsource.xml. If you don’t want to edit the template, create this folder and put “memsource.xml” in this path. Alternatively edit the template:
    Select Resource console > Templates > memsource with states > Edit > Automated actions > Script before import and edit path in Command line arguments field, then click Update.
    You can now create template project and import Memsource files.
Tagging mechanism will create empty (single) tags for numbers enclosed in curly brackets ( {1} ), opening (left) tags for any content starting with left curly bracket and closed by “greater than” sign (e.g. {1> or {i> ) and closing (right) tags for any content starting with “less than” sign closed by right curly bracket (e.g. <1} or <i} ). However, it is unlikely but possible that incorrect content will be tagged. In such case please contact me.
PRO tip: File extension “mxliff” is not recognized by memoQ, so when you are adding files to memoQ project, you need to “Show all“. But when you create a project based on this template you can skip “Add files” step (just don’t add any files) and when the template-based project is created, simply drag and drop mxliff files into “Translations” memoQ window. Files will be recognized and correct filter will be applied automatically.

To update already installed template you need to:

  1. Using resouce console delete existing filter configuration and project template and install updated version
    OR
  2. Using resouce console rename existing filter configuration and project template and install updated version
    OR
  3. Import updated filter configuration with new name, import updated project template with new name and modify it to include updated filter configuration name.
Please note: the templates reference FindAndReplace.exe file, which should be available at C:\Program Files (x86)\Kilgray\FindAndReplace Tool folder (for memoQ 8.1 and up). If you have non-standard memoQ installation path, you need to edit exe configuration in template settings (see below). If you have memoQ version older than 8.1, you need to download the file separately and edit the path in template settings:
  1. Select Resource console > Templates > memsource with states > Edit > Automated actions > Script before import > Select findandreplace.exe and click Delete.
  2. Click Add files…, browse to and select FindAndReplace.exe.
  3. Click Update.
Template can be further customized with your default languages, TMs, light resources etc.
Additional help for templates with find and replace scripts can be found here: https://help.memoq.com/8-3/en/index.html?edit-template-find-and-replace.html
Template configuration file (actual find and replace commands) is commented and you can customize it any way you like. Source: http://wasaty.pl