Tags: CMS12 Optimizely/Episerver

Localized page types and properties in Optimizely CMS 12

In Optimizely CMS you can name your content types, and properties, using the [ContentType()] and [Display()]-attributes, like this.

public class BlogPostPage : PageData
    [Display(Name = "Tekstinnhold")]
    public virtual XhtmlString MainBody { get; set; }



If you have editors that use different languages, you might want localized content type and property names.

Step 1 – create an xml file for each language

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
  <language name="norsk" id="no">

Step 2 – add the following to startup.cs

services.AddLocalizationProvider<FileXmlLocalizationProvider, NameValueCollection>(o =>
        o[FileXmlLocalizationProvider.PhysicalPathKey] = "language";

Set the value  PhysicalPathKey to the path where you keep your XML files.

That's all!