Skip to content

Sitefinity/microsoft-machine-translation-connector

Repository files navigation

Machine translation connector for Microsoft Translator

Latest supported version: Sitefinity CMS 14.1.7800.0

Documentation articles: Custom translation connector

IMPORTANT: This repository may not be compatible with the latest or your current Sitefinity CMS version. If you want to use the repository with a specific Sitefinity CMS version, either upgrade the code from this repository or your Sitefinity CMS project to ensure compatibility.
The dev team monitors the repository. You can create a GitHub issue to submit feedback or report bugs. Or make a pull request to submit project enhancements or compatibility changes that support new Sitefinity CMS versions.

Overview

In addition to the built-in Translation module connectors, you can implement your own translation connector with custom logic to serve your requirements.

This repo contains a translation connector to work with the Microsoft Azure Translator V3 API service.

Prerequisites

  • You must have a Sitefinity CMS license.
  • Your setup must comply with the system requirements. For more information, see the System requirements for the respective Sitefinity CMS version.
  • You must sign up for Microsoft Translator Text API V3 service in Microsoft Azure. For more information, see How to sign up for Translator. Then you can use one of the generated API keys to configure the connector in Sitefinity CMS. All of the available tiers are supported.

Installation

Add the Microsoft translation connector sample project to your solution. To do this, perform the following:

  1. Open your Sitefinity CMS solution in Visual Studio.
  2. Add Progress.Sitefinity.Translations.MicrosoftMachineTranslatorConnector project to the same solution.
  3. Ensure Telerik.Sitefinity.Translations nuget package is installed in Progress.Sitefinity.Translations.MicrosoftMachineTranslatorConnector.
  4. In SitefinityWebApp, add a reference to the Progress.Sitefinity.Translations.MicrosoftMachineTranslatorConnector project.
  5. Build your solution.

Configure the connector

Using one of the generated API keys, configure the connector in the following way:

  1. In Sitefinity CMS backend, navigate to Administration » Settings » Advanced.

  2. In the treeview on the left, expand Translations » Connectors » MicrosoftMachineTranslatorConnector » Parameters.

  3. Set the apiKey parameter to the API key provided by Microsoft Azure.

  4. Set the baseURL to one of the URL’s supported by Microsoft Azure API. For more information, see Microsoft Azure documentation » Translator v3.0 » Base URL's. If you do not set the baseURL parameter, the system takes the Global (non-regional) base URL.

  5. Set the region parameter to one of the regions, supported by Microsoft Azure API. If you have not changed the baseURL parameter from the default one, you do not need to configure the region parameter. For more information, see Microsoft Azure documentation » Authenticate requests to Azure Cognitive Services » Supported regions.

    IMPORTANT: The Azure geography of the base URL must include the region that you have configured.

  6. You may optionally configure any additional parameter of the Microsoft Translator service described in Translator 3.0: Translate. To do this, click queryString on the left. In the Value field on the right enter the parameters.

    IMPORTANT: You format the string in the Value field using the query string format without the leading ? or & characters. You separate the translator parameters with &.

  7. Navigate back to MicrosoftMachineTranslatorConnector.

  8. Select Enabled and deselect Strip HTML tags.

  9. Save your changes.

Additional resources

For more information for supported languages, see Language and region support for text and speech translation.