Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Linus Ekström
Dec 5, 2013
  6689
(0 votes)

New standardized format for content type localizations

In EPiServer 7.5, there is a new standarized way how to add localized texts for content types. In previous versions of EPiServer there was separate section for each content type, for instance:

<language id="en" name="English">
    <pagetypes>
        <pagetype name="PageListBlock">
            <name>Page List</name>
            <description>Displays a list of pages, for example to display recent news</description>
        </pagetype>
    </pagetypes>
</language>

 

Since the amount of “base” content types has grown significally in EPiServer 7.5, specifically when taking EPiServer Commerce into consideration, we decided to normalize how content localizations are handled. All content types are now added under the top level section named “contenttypes”. The format has also changed a bit as seen below:

 
<language id="en" name="English">
  <contenttypes>
    <standarpage>
      <name>Standard Page</name>
      <description>A plain vanilla page.</description>
    </standarpage>
    <teaserblockcontrol>
      <name>Teaser</name>
      <description>Used to insert a content teaser</description>
    </teaserblockcontrol>
  </contenttypes>
</language>

 

Adding localized texts for properties can be done either to a specific content type:

<language name="en">
  <contenttypes>
    <startpage>
      <name>Start page</name>
      <description>A description of the page type</description>
      <properties>
        <searchresultpagelink>
          <caption>Search Result Page Link</caption>
          <help>Link to search result page.</help>
        </searchresultpagelink>
      </properties>
    </startpage>
  </contenttypes>
</language>

 

Reusing localization for properties between content types

It is also possible to add common translations to an inherited type, for instance pagedata or icontentdata:

<language id="en" name="English">
  <contenttypes>
    <icontentdata>
      <properties>
        <disableindexing>
          <caption>Disable indexing</caption>
          <help>Prevents the page from being indexed by search engines</help>
        </disableindexing>
      </properties>
    </icontentdata>
  </contenttypes>
</language>
Note: If you have your own base classes that are not registered as content types and you want to add the translations to these classes you need to create a UIDescriptor for the base class.

Localizing headers

Headers (tabs for instance) can be localized in the top level section “groups”:

 
<language name="en">
  <groups>
    <advanced>Advanced</advanced>
    <categories>Categories</categories>
  </groups>
</language>

 

Upgrading existing language files

When using Deployment Center to upgrade a site, the upgrade process will try to convert any xml files in the “lang” and “Resources\LanguageFiles” folders given that that process can write to these files (they cannot be read only for instance). If you have existing files in other locations or want to do the conversion manually for some reason (check in to source control for instance) there is a small program that can be used to convert existing files. Just select the folder where the files you want to convert are located and press “Convert Content Type Sections” and the files should be updated to use the new format. You can download the program here.

Dec 05, 2013

Comments

Please login to comment.
Latest blogs
Optimizely Configured Commerce and Spire CMS - Figuring out Handlers

I recently entered the world of Optimizely Configured Commerce and Spire CMS. Intriguing, interesting and challenging at the same time, especially...

Ritu Madan | Mar 12, 2025

Another console app for calling the Optimizely CMS REST API

Introducing a Spectre.Console.Cli app for exploring an Optimizely SaaS CMS instance and to source code control definitions.

Johan Kronberg | Mar 11, 2025 |

Extending UrlResolver to Generate Lowercase Links in Optimizely CMS 12

When working with Optimizely CMS 12, URL consistency is crucial for SEO and usability. By default, Optimizely does not enforce lowercase URLs, whic...

Santiago Morla | Mar 7, 2025 |

Optimizing Experiences with Optimizely: Custom Audience Criteria for Mobile Visitors

In today’s mobile-first world, delivering personalized experiences to visitors using mobile devices is crucial for maximizing engagement and...

Nenad Nicevski | Mar 5, 2025 |

Unable to view Optimizely Forms submissions when some values are too long

I discovered a form where the form submissions could not be viewed in the Optimizely UI, only downloaded. Learn how to fix the issue.

Tomas Hensrud Gulla | Mar 4, 2025 |

CMS 12 DXP Migrations - Time Zones

When it comes to migrating a project from CMS 11 and .NET Framework on the DXP to CMS 12 and .NET Core one thing you need to be aware of is the...

Scott Reed | Mar 4, 2025