Machine Translation Wordfast Classic

From Wordfast Wiki
Jump to: navigation, search

Using a local (installed in Ms-Word) MT resource

During a translation session, when no match is found in the translation memory, WFC can request an on-the-fly translation from a installed translation program, such as Systran™, Power Translator Pro™, PROMT Reverso™, etc. After purchase and installation, these MT programs act as Ms-Word add-ons, just like WFC. There are four ways your Ms-Word MT add-operates to have the document, or a selection of text, or the current paragraph, machine-translated:

  • By adding a menu in Ms-Word. The user uses this menu to request the translation;
  • by adding a toolbar in Ms-Word. The user clicks an icon to request the translation;
  • by adding a contextual menu. The user selects a portion of text then right-clicks the selected text with the mouse and chooses a sub-menu to have the selection translated;
  • by adding a macro. The user executes the macro to have the currently selected text translated.

For each method, you will need to provide two parameters that tell WFC how to request the translation. These two parameters are entered with a comma as separator. Here are the parameters you will have to provide for each situation:

The menu name, then the sub-menu that triggers the translation of the selection or the current paragraph (not the entire document's translation). This could be "Systran,Selection" or "Translate,Selection" for example, with Systran 3, Systran 4, Power Translator pro 6 and 7.

The toolbar name and the icon name. Your MT add-on's toolbar name is found in Ms-Word's "View/Toolbars" menu. You don't need to quote the entire toolbar's name, just a keyword that is special to this toolbar's name (maybe like "PROMT" or "Systran"). The icon name appears as "tip" when the mouse hovers over the icon. Note this icon name. This could be "Translate paragraph" for example. So the entire parameter could be "PROMT,Translate paragraph".

Select a portion of text and right-click on it. Note the name of the contextual menu that's used to translate the current paragraph (this could be "Translate paragraph", for example). The parameter to enter would then be "Contextual,Translate paragraph".

Note the macro's exact name (like "MTMacro"). The parameter to enter would be "Macro,MTMacro".


To set up MT activation:

Go to WFC's Translation memory/MT tab. Check the "Menu, sub-menu for MT" checkbox.

In the text box immediately after the checkbox, enter the parameter as defined above. If you work on tagged files with an MT package that does not support tags, check the "Remove tags" option (if you are not sure what this means, check "Remove tags").

Close WFC. In Ms-Word, test your translation package on a short sentence to see if it is correctly set up and running.

This is the normal procedure, and it works with Systran, Power Translator Pro, PROMT Reverso on all versions, and most other packages. Some trial-and-error may be required to have it run.

On systems running Systran4, the Systran add-on that links Ms-Word to the Systran engine must be in Ms-Word's "Startup" folder (as is the case after Systran's regular installation procedure is carried out), so that it is loaded on startup. Systran may not work if its add-on is simply activated after startup.

Using a remote, Web-based MT resource

WFC can connect to various Machine Translation sources. Note that many of those sources are subscription-based, and you will need one or two secret keys (aka "API ID") to connect to them.

WFC has a special deal with WorldLingo, which is why WorldLingo MT is free and unlimited for WFC users. WL covers a very wide array of languages - but not absolutely all of them. If your language pair is covered, as the saying goes - go for it!

Multiple MT sources can be enabled at the same time. It's an exciting way to have giants like Microsoft or Google compete to offer you their best MT, and to compare their skills. Oh well, your skill will probably be an order of magnitude better than those of the multi-billion-dollar giants...

Note that alternate settings for other MT sources can be set up, provided those sources can be queried via URL and a re using the REST protocol.

!Note on confidentiality, secrecy, NDA compliance, etc. As is obvious, using a remove MT resource means that each source segment, as you translate, travels over the web to a service that will machine-translate it, then send back the proposed translation, usually of questionable quality. There are two importants things to note:


  • Make sure that this method does not conflict with the level of confidentiality that your client expects of you. The source segments will be entrusted to a third party (the machine translation service). Most machine translation services do not stock and reuse source segments submitted for MT; some do.
  • WFC only sends source segments to the distant MT service. It does not send back the final, corrected target segment once you have worked on it. In other words, your translation is not supplied to the distant MT service to make their MT engine better. Some MT providers may request the final, target segment, which is sometimes called a "Suggest-a-better-translation" scheme. WFC does not engage in that scheme.

Creating a custom MT connector

Note: this section is DIY (Do It Yourself). Our hotline cannot assist in the customization of an MT engine, because that requires knowledge of the remote provider's specifications. However, public discussion groups may offer help.

If your remote Machine Translation provider is not listed, it is possible to create a custom connector for it. This is only possiblle if your MT provider's API is using a REST standard, and returns results in a JSON, or similar, format. That is the case with all MT providers currently available with WFC (Google, Microsoft, WorldLingo, iTranslate4.eu, MyMemory, etc.).

Let's assume your preferred MT provider is WorldLingo and we create a custom engine for it. You explore WorldLingo's API documentation. It essentially boils down to a query URL, with parameters. In

In WFC's Machine Translation setup, select a "Custom" MT engine, then enter the following as API key:

url= http://www.worldlingo.com/S000.1/api?wl_data={ss}&wl_srclang={ss}&wl_trglang={tl}&wl_password=secret{jsonkey=}

Note the various elements:

url= tells WFC what URL is used.

{jsonkey=} tells WFC how to spot the returned translated segment. There is no json keyword with WorldLingo, this is why it is left empty; other providers usually have keywords like translation, translatedText, etc.

Inside the URL:

  • {ss} will be replaced with the source segment to be translated. This parameter must be present.
  • {sl} and {tl} will be replaced with your source and target language codes (two-character, lower-case). However, if you only work in one language pair, it is advised to hard-code (write in clear form), your language codes, replacing those two {sl} and {tl} codes in the URL. Only your MT provider can tell you what those codes are. Most MT providers use lower-case, two-character ISO language codes, as in a standard Wordfast TM.

Practical example: Opening a browser, you begin by testing the URL. In the following example, the raw URL was customized for an English-to-French language pair, to translate "Hello World". Your real URL will look different, the following is an example based on WorldLingo:

http://www.worldlingo.com/S000.1/api?wl_data=Hello%20world&wl_srclang=en&wl_trglang=fr&wl_password=secret

You can try pasting the above URL into a browser's address bar. If things go well, the site will send a reply:

Bonjour le monde

Other MT providers may use a more complex JSON reply, in which case you specify the JSON key so that WFC can identify the result (here the key is "translation" so you would use {jsonkey=translation}:

{"responseData":{"translation":"Bonjour le monde","match":1} }

Your MT provider may require more parameters, such as a secret ID key (aka an API key), or other elements, in which case, you should hard-code those in the URL.

  Back to Wordfast Classic User Manual