Translating content in Optimizely CMS with Anthropic Claude
Back in 2023 I published an add-on that connected Optimizely's EPiServer.Labs.LanguageManager to OpenAI, so editors could translate content without leaving the CMS.
This is the same tool with a different engine underneath. Gulla.Episerver.Labs.LanguageManager.Anthropic plugs Anthropic Claude into LanguageManager. If you've used the OpenAI version, the workflow is exactly the same.
What it does
LanguageManager already copies content across language branches. This add-on supplies the translation. Add the Languages gadget, pick your languages, and Claude does the rest. Nothing leaves the familiar editor flow.
Getting started
Add the NuGet package to your Optimizely CMS project:
dotnet add package Gulla.Episerver.Labs.LanguageManager.Anthropic
Then call .AddLanguageManagerAnthropic() in ConfigureServices. The only required setting is the API key:
.AddLanguageManagerAnthropic(x => {
x.AnthropicApiKey = "**********";
x.AnthropicModel = AnthropicModels.ClaudeHaiku4_5;
x.AnthropicMaxTokens = 8192;
})
Select the Anthropic provider in LanguageManager's settings, and you're ready to translate.
Choosing a model
The default is Claude Haiku, fast and cheap, which is what most translation work needs. When a piece of content deserves more care, move up to Sonnet or Opus. AnthropicModel takes any valid model identifier, and the AnthropicModels class has constants for the current ones. You can set all of this in appsettings.json too, which is handy when it differs between environments.
Letting editors steer the translation
Translation quality usually comes down to instructions: tone, formality, how to handle product names and domain terms. You can hard-code an extra prompt in configuration, or you can point the add-on at a CMS page and a text property instead:
.AddLanguageManagerAnthropic(x => {
x.AnthropicApiKey = "**********";
x.AnthropicExtraPromptPageContentReference = 5;
x.AnthropicExtraPromptPagePropertyName = "TranslationExtraPrompt";
})
The page is read on every translation, so editors can tweak the instruction themselves, no redeploy needed.
Which version for your CMS?
There are two versions, one per CMS generation. Install the one that matches your project:
- CMS 12: Use the 1.x packages. These multi-target .NET 8 and .NET 10, so they work whether or not you've moved to .NET 10 yet.
- CMS 13: Use the 2.x packages. CMS 13 is .NET 10 only, so this build targets .NET 10.
Try it
The add-on is open source and on NuGet. Issues and pull requests are welcome.