Create a Translation Connector

A Language Service Provider (LSP) can help you translate a site. With a translation connector to the LSP, you can submit and ingest translation jobs.

Before you submit a translation job, you need to create a translation connector. To translate a site without an LSP, you can create a mock translation connector to run against. Use the cec create-translation-connector command to create a translation connector and the cec start-translation-connector command to start it:

cec create-translation-connector connector1
 - translation connector connector1 created at <sites-toolkit folder>/cec-components/src/main/connectors/connector1
 - install connector
. . .
Start the connector: cec start-translation-connector connector1 [-p <port>]
cec start-translation-connector connector1 -p 7777
NodeJS running. . .:
Site page: http://localhost:7777

Use the Content Toolkit to test the translation connector by running it through the expected APIs:

  1. Register the connector with Content Toolkit.

    >cec register-translation-connector
  2. Open up the toolkit and go to the "Translation Connections" page.

    >http://localhost:8085/public/translationconnections.html
  3. Run through the steps on the translation connector validation page. These steps use the translationBundle.zip file in the /data folder in your connector environment to validate your connector.

You can use the Translation Connector SDK to develop a translation connector for Oracle Content Management. This SDK is a sample NodeJS implementation of the Translation connector API. The sample accepts an Oracle Content Management translation job zip file, translates all the resource in the file, and returns a new zip file containing all the translations.

The SDK requires the user to have access to an LSP to do the actual string translations. A mock LSP server is included in the SDK to mimic the responses from an LSP by simply prepending the targeted locales to the strings.

The Translation Connector SDK consist of three main modules.

  • Connector: The translation connector that implements the required Oracle Content Management Translation Connector API.

  • Job Manager: A file system-based sample job manager that maintains the state of the connector jobs while they are translated by the Language Service Provider.

  • Provider: The implementation of the specific set of APIs required by your LSP to submit documents for translation and retrieve the translated documents.

You can copy the mock translation Provider JS and implement all the methods inside it.