HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In

Optimizely Languages

Describes Optimizely Languages, which provides easy access to a single interface for managing multiple languages and translations of content, with a built-in feature for managing automated translations.

Optimizely Languages can be used to export and import XLIFF files that can be sent to inhouse translators or localization agencies.

ITranslationPackageExporter and ITranslationPackageImporter are interfaces used for import and export of translation packages to a project. The default implementations are XLIFFTranslationPackageImporter and XLIFFTranslationPackageExporter.

Requirements

  • No additional license fee.
  • An Optimizely Content Management System (CMS) or Optimizely Customized Commerce installation.
  • See Add-ons platform compatibility for package and version information. 

Install

  • Versions 7.5 and higher are installed through NuGet.
  • Version 7 is installed and updated through one-click installation.

Documentation

Configure auto-translation

This section describes how to configure an auto-translation service for the Optimizely Languages app. Optimizely Languages uses as its translation provider Microsoft Translator, which is part of the Microsoft Cognitive Services collection of APIs, available in the Azure portal. The following steps show how to configure the auto-translate option.

Connect to the auto-translation service

  1. Subscribe to Azure, if you haven’t done so already.
  2. Configure the auto-translate component in Optimizely Languages.
    1. Go to admin view > Config > Tool Settings > Language Manager.
    2. In the Translator Provider, select Cognitive Service Translator.
    3. In the Subscription Key box, enter your Microsoft subscription key (Key 1).
    4. In Subscription Region, enter the Location value from the Azure subscription service.
    5. Save your changes.

See also: Reminder: Move Translator API subscriptions from DataMarket to Azure before April 30, 2017.

Configure translate children blocks

This section describes how to configure Optimizely Languages to translate children blocks in a ContentArea attribute. To archive this, add the Optimizely Languages section in appsettings.json like this:

{  
    "Episerver": {  
        "CmsUI": {  
            "LanguageManager": {  
                "TranslateOrCopyContentAreaChildrenBlockForTypes" : [  
                  "AlloyTemplates.Models.Pages.ExamplePage1",  
                  "AlloyTemplates.Models.Pages.ExamplePage2"  
                ]  
            }  
        }  
    }  
}

The value in the array can be a regex so you can write a single "AlloyTemplates.Models.Pages.*" to enable this to all contents that has the namespace AlloyTemplates.Models.Pages.

Breaking changes for Languages version 2

This topic describes API changes in version 2 of Episerver Languages.

📘

Note

Episerver Languages was renamed to Optimizely Languages.

Changed

Introduced new methods in the ILanguageBranchManager interface and its implementation, LanguageBranchManager. Compared with old methods, the difference is that the new method returns newly created content as an out paramenter (createdContentLink):

bool CopyDataFromMasterBranch(ContentReference contentReference, string fromLanguageID, 
  string toLanguageID, Func<object, object> transformOnCopyingValue, 
  out ContentReference createdContentLink, bool autoPublish = false);

bool CreateLanguageBranch(ContentReference contentLink, string languageID, 
  out ContentReference createdContentLink);

bool TranslateAndCopyDataFromMasterBranch(ContentReference contentReference, 
  string fromLanguageID, string fromTwoLetterLanguageName, string toLanguageID, 
  string toTwoLetterLanguageName, out ContentReference createdContentLink, 
  bool autoPublish = false);

Marked as obsolete

The following functions in ILanguageBranchManager and its default implementation LanguageBranchManager are obsolete and will be removed in an upcoming release:

bool CopyDataFromMasterBranch(ContentReference contentReference, string fromLanguageID,  
  string toLanguageID, Func\<object, object> transformOnCopyingValue,  
  bool autoPublish = false);

bool CreateLanguageBranch(ContentReference contentLink, string languageID);

bool TranslateAndCopyDataFromMasterBranch(ContentReference contentReference,  
  string fromLanguageID, string fromTwoLetterLanguageName, string toLanguageID,  
  string toTwoLetterLanguageName, bool autoPublish = false);

New dependencies 

Languages 2.0 depends on newer packages: EPiServer.CMS.Core 9.8, EPiServer.CMS.UI 9.5.0