Share via


Building a Translation Service

Language-translation services represent a special category of research services and involve some special implementation procedures in addition to the steps discussed in Handling Registration Requests and Handling Queries.

Registering a translation service

If you want to provide bidirectional translation support—for example, from English to Spanish and from Spanish to English—you need to register a separate service for each direction.

Certain elements in the registration response packet must contain particular values, as shown in the following table.

Element Value
Name (of Provider) The provider name cannot contain the ampersand character (&).
Data The Data element contains the locale ID values for the "from" language and the "to" language, followed by the value "1" to indicate a regular word-by-word translation service, for example, 1033/3082/1 for English to Spanish. The value "2" in the third position indicates a whole-document translation service. (See the note following this table.) Other values you may see in the third position (for example, 4 and 8) are for internal use only.
Display Hidden.
Category REFERENCE_TRANSLATION.

Note  If you examine the list of translation services in the registry, you may notice some services that have the phrase "(Whole Document)" in their name. These services use an API distinct from the Research Web service methods discussed in this SDK to translate entire HTML pages. For additional information, see the Translation Dictionaries Content Development Kit in the Microsoft Developer Network (MSDN) Library. This CDK remains unchanged for Microsoft® Office 2003.

Querying a translation service

The response to a translation query supports only the Microsoft.Search.Response.Content namespace. For properly formatted results, return only a single Content element. If the response packet contains elements from the Microsoft.Search.Response.Document or Microsoft.Search.Response.Form namespaces, the Research task pane disregards those elements. If the response packet contains multiple Content elements, the Research task pane displays a new service heading for each Content element. This layout may be misleading to the user.

Notes

  • The Office 2003 version of the Research task pane does not pass the RequeryContext and ServiceParameters elements in queries sent to a translation service. The Query Web method of a translation service should not check for these elements. For more information about these elements, see Handling Queries.
  • The Research task pane disregards the providerRevision attribute in translation query responses. Therefore, translation services cannot easily advertise the availability of updates to users. However, users can initiate an update of the translation service manually from the Research Options dialog box. For more information about the use of the providerRevision attribute, see Updating and Removing Services.