Tags: AI CMS12 Optimizely/Episerver

Auto-translate with OpenAI GPT-4o in Optimizely CMS

If you work with Optimizely CMS and a website with more than one language, the Optimizely Languages addon (formerly LanguageManager) makes everyday tasks much easier. This extension provides an easy overview of existing language versions,  and allows you to create and delete language versions easily.

For at least five years, the addon has been able to auto-translate from one language to another using Azure Cognitive Services.

Over the past year, there has been significant development in large language models (LMMs), so I thought it must be possible to use one of the models from OpenAI for translations, instead Azure Cognitive Services, which was the only supported solution from Optimizely.

After some trial and error, I managed to put together a new extension for the extension, allowing you to now use any language model from OpenAI for automatic translations with the Optimizely Languages addon.

Simply install the NuGet package and add an API key from OpenAI, and you can choose the new Translator Provider.

Grafisk brukergrensesnitt, applikasjon

Now, all that's left is to add the Optimizely Languages gadget, if you haven't used it before. Here's how you do it.

Grafisk brukergrensesnitt, tekst, applikasjon, e-post

Then you can select "Auto-translate" when creating new language versions, and OpenAI will handle the translations.

Grafisk brukergrensesnitt, tekst, applikasjon

As always with AI-generated content, I recommend using this only as a starting point for human review and improvement – but it should provide a good foundation that can save you time.

By default, the new model GPT-4o will be used for translations, but you can choose another model via configuration. Similarly, you can set the "temperature" to control how conservative or creative you want the translations to be. You can also define a custom "prompt," which is an additional instruction to the language model on how the translation should be performed. This can include information about tone of voice, formality level, or similar aspects.

Starting from Optimizely Languages version 5.3, you can also automatically translate parts of the tree structure simultaneously, including child and related content. When you select "Auto-translate" in the previous screen, you will get the option to also translate subpages and related content.

Prior to version 5.3 only single pages could be translated.

Grafisk brukergrensesnitt, tekst, applikasjon, e-post

You can read more about these new features in the Optimizely documentation, but my new Translator Provider works just as well here.

Good luck with the translations!