Skip to content

Best Practices for Sitecore Internationalization, Part 1

The Sitecore CMS provides useful features to create and manage websites targeted to global markets. Even though Sitecore provides a straightforward way for handling localized content, designing a multilingual website in a way that is extensible and maintainable can be challenging. In this blog, I am going to cover some of the best practices for creating an internationalized Sitecore website.

Content Structure

The content structure hierarchy needs to be carefully thought out, as this not only impacts the performance, but also the extensibility and maintainability. There are multiple approaches for structuring your content.

One of the aspects you should consider is how much the content could vary from one locale to another. In some cases, the entire website is the same and you just want to display the content in a different language with some minor differences. If that’s the case, you could just consider following the approach of keeping the content in the traditional structure and maintaining different language versions for each content item.

Sitecore - 1

In other cases, you may want to display a very different website for a specific locale, with its own images and specific sections. If that’s the case, you could think about a structure with a Global node under Content, which will contain your default website for multiple locales and then, at the same level, a new node for each specific locale that needs to be considered separately, for example, Spain or Argentina.

  • Content
    • Global
      • Home
    • Argentina
      • Home
Media Library Structure

A media library is also very important to keep organized, especially when you are going to keep files with different versions for each locale.

If you want to separate media files based on different countries, you could follow a similar approach as mentioned previously for content. You could have something like the following:

  • Media Library
    • Global
      • Images
      • Videos
    • Argentina
      • Images
      • Videos

Also, you may not want to separate media by country, but by language.

  • Media Library
    • Global
      • Images
      • Videos
    • ES
      • Images
      • Videos

You could also follow a mixed approach, where you can put specific content for a certain country and language.

Additionally, you could restrict or disable media uploads directly under some specific levels, like the country name node, the language name node or the media root node.

Localized PDFs

As we mentioned initially, Sitecore makes it simple to create multiple language versions of a content item, but it’s not so simple when trying to do the same with PDFs. By default, Sitecore creates PDF items using the unversioned PDF template, meaning that the uploaded media file is shared across all languages. There are different ways to get around this.

The simplest method is to encourage content authors to use the Upload files (Advanced) option when uploading files. By selecting the checkbox with the option “make uploaded media items versionable”, it will create the media items using the versioned PDF template, allowing authors to then upload media files per language version of the media item. In order to do this:

  • Go to Media Library (in the content tree).
  • Select the folder where you want to upload the file.
  • Select the Folder tab.
  • Click on Upload files (Advanced).
  • Select the file you want to upload.
  • Check the item Make uploaded media items versionable.
  • Click on the upload button.

The previous method is simple, but it depends on authors to know or remember that step. There is an additional way to enforce all uploaded PDFs use the versioned PDF template. To do this, you could add a custom processor to the uiUpload pipeline that runs after Sitecore’s save processor. Then, in the processor you could add some code to detect if the PDF was uploaded using the unversioned PDF template and switch it to the versioned PDF template. For a further reference about how to perform this, go to the following link and check the title “Extend the uiUpload Pipeline”.

Layout

When defining the layout for your website, it’s important to keep in mind that not all the layouts work equally well with global websites. Text translated into a specific language doesn’t necessarily have the same length as the text in the source language. Having a layout that doesn’t adapt to different text lengths could cause the text to be displayed incorrectly, with some overflows or incomplete sentences. Additionally, there are some languages that follow some specific rules, for example, Arabic, which is displayed from right to left.

As a result defining a layout that isn’t built with these kind of details in mind, can introduce a number of issues when introducing translated content into our website.

Dictionary

The dictionary is a feature of Sitecore that relies on a set of key/value pairs. One of the main benefits of putting content into the dictionary is that it can be reused in different areas by simply referencing the entry by its key. A benefit of the centralized storage, is that the translation only needs to be performed once and then it’s replicated in all the places that use it.

Summary

During this article, we explained some of the best practices to consider while working on Sitecore-based projects that need to go global. Of course, this list of practices isn’t exhaustive and, as you get more experience with the CMS itself, you may find some other practices for global projects. Keep in mind that designing sites for global audiences is an evolving challenge.