HomeDev GuideRecipesAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Add a custom language

Describes how to add a custom language to CMS.

Add custom language and locale combinations to CMS to support languages unavailable on the host operating system.

CMS reads available languages from the host operating system. Available languages vary between machines, which limits the default options.

Create and enable custom languages programmatically, such as en-SE for English in a Swedish market.

The following code adds a custom language:

ILanguageBranchRepository _repository; // Resolved via dependency injection  

_repository.Save(new LanguageBranch(new CultureInfo("xx-YY"))
{  
    Name = "My custom language",  
    URLSegment = "xx-yy",  
    Enabled = true  
});