Tuesday, June 4, 2013

Using auto-translatables for number format conversion in MemoQ

Among other things, the auto-translatables function in memoQ can be used to convert numbers from one language format to another. For example, English uses the comma as a thousands separator, and the full stop as a decimal separator. Italian uses them the opposite way. With the proper auto-translatable rules set, memoQ will provide the "localized" version of numbers found in the source segment. These localized numbers are shown in the Translation results list. These auto-translated hits can be inserted quickly into the translation just like hits from translation memories or term bases. Auto-translatables are also used by the fragment assembly function.
Auto-translatables can be set at the project level (in the settings page of the project) or the global level for every project with the same source and target languages (in Tools menu > Options > Auto-translatables).
English to Danish/Dutch/Croatian/German/Romanian/Slovenian/Spanish
Below are the rules to enter for a project translated from English to the above (and possibly other) languages. It will localize numbers containing decimal separators or thousands separators (not both). The rules need to be entered exactly as below in the exact same order to ensure that they work correctly. For information on entering auto-translatable rules, see the memoQ help topics under Language specific settings > Auto-translations.
Rule 1 (changes 1.234 to 1,234)
Auto-translatable rule:
(\d+)\.(\d+)
Replace order rule:
$1,$2
Explanation: If a sequence of digits is followed by a full stop and another sequence of digits, this rule will replace the full stop with a comma.
Rule 2 (changes 12,345,678 to 12.345.678)
Auto-translatable rule:
([\d]{1,3}),?(\d\d\d),?(\d\d\d)
Replace order rule:
$1.$2.$3
Explanation: If a sequence consisting of 1 to 3 digits is followed by a comma, which is followed by three digits, another comma and thrre digits again, the rule will replace the commas with full stops.
Rule 3 (changes 12,345 to 12.345)
Auto-translatable rule:
([\d]{2,3}),?(\d\d\d)
Replace order rule:
$1.$2
Explanation: If a sequence consisting of 2 to 3 digits is followed by a comma, which is followed by three digits, the rule will replace the comma with a full stop.
Source: http://kilgray.com