Auto-translation rules, or “autotranslatables” as some call them, are a unique standard feature of memoQ found in no other translation environment today. These rules map structured information from source texts to a desired equivalent in the translation and can be used to create insertable hits (similar to term base matches) in the translation results pane of the workspace, to give instant feedback (with warnings) if the target language text is not as expected, or to perform automated quality checks using a memoQ QA profile.
What kind of structured information? Well, dates for example.
This video shows how various date expressions in English are automatically translated into the target language (Dutch) and inserted into the target text (so they need not be typed):
The insertion can be made by double-clicking the green highlighted matches in the source text or the match in the translation results pane, or by using a keyboard shortcut (control key + the number of the translation result).
The video begins in the Settings of an open project. This is where the desired rulesets can be selected by marking the checkboxes next to their names in the list. Rule assignments can also be made automatically for new projects using the memoQ Options (Category: Default resources) for local projects, the Server administrator (Category: Default server resources) for online projects, in project templates for both local and online projects.
As seen in the video, the rules handle dates in the common long date format for US and UK English as well as day + month (no year) or month + year (no day).
So these rules are probably useful if you translate from English to another language. But what if that other language isn’t Dutch? No problem.
If you have these English to Dutch date rules and need the dates converted from English to a different target language, and you are using memoQ and its integrated tools for resource management and editing,
clone a copy of the original rules and rename them for your language pair
open the renamed ruleset for editing and go to the Translation pairs tab. where you can change the Destination (target language text) for the
#months#
group to the correct month name in your desired target language
Then go to the Auto-translation rules tab and adapt the Replace order rules in an appropriate way for your target language:
Difficult, you say? Well, yeah, you can’t see the whole rule text in the dialog, because the fields are too small. But you can stretch the dialog a bit for better visibility:
What? You say you still have no idea what to do with all that mysterious gibberish? And haven’t I been telling you that you don’t have to learn regex?
Well, it’s true. If you are given the prepared resource (which can be downloaded below), all you have to do is import it to memoQ (in the Resource Console, Options or Server Administrator, or in the Project settings) and enable it in a project, and you’re good to go.
But to adapt those rules for another language, documentation is important. Even if you are a regex syntax expert, it isn’t always easy to pick apart the regular expression quickly and recognize what it is doing and how it needs to be adapted. There are a number of ways to approach this documentation challenge; my preferred method, as explained in a recent post, is to use an external code editor to maintain and comment the resource:
The green comments contain all the hints you need to explain what each rule does and to understand how the replacement regex for the target text needs to be adapted.
The identity of each group is explained in the comment. So to change these rules from English to Dutch into English to Portuguese date rules, for example, the text enclosed in the replaceRule
tags — $3\u00A0$2 $4
— might be changed to $3 de $2 de $4
(no encoded non-breaking spaces [\u00A0
] here, so add these as you please if necessary). By making such changes, you’ll have usable rules from English to your target language in minutes.
Rules like these are especially useful if your styleguide demands that non-breaking spaces or other special characters be used, as errors with space type, dashes or some other characters are often hard to recognize visually.
Some of you may be a bit familiar with date rules like this from regex workshops or webinars, but the rules here may seem overly complex. That’s a subject for another time. These were developed for use with highly inconsistent source texts or with different source texts following different date conventions in English. If you want to avoid doing conversions for invalid dates like May 55th, 2002, then the regex will get even ickier. But no worries… if the rules work to capture the source text patterns, all you need to concern yourself with is the replacement rules. I’ll do a deeper, nerdy dive on another occasion to discuss many considerations which might apply in regex development, simply as a way of showing how these things may not be as “simple” as they appear with a few glib examples in a webinar.
But for now, here is a link to the English to Dutch date rules, along with the test data used for the video:
And just to save some of you a little bit of work, below are some rules for a few other language pairs with English as the source text (Croatian, Finnish, French, German, Portuguese, Romanian, Spanish, Swahili and Ukrainian). The format coverage may differ from the Dutch examples in some cases, but it’s a good student exercise to compare rulesets to help you make exactly what you want. Or you can contact me or some other expert for a little help. Some of the *.zip
files also contain rules for handling short date formats, or the test data differ.
Keep reading with a 7-day free trial
Subscribe to memoQuickies Substack to keep reading this post and get 7 days of free access to the full post archives.