Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Multilingual SharePoint Publishing Sites

I work for SpringPoint Technologies, they are a Microsoft Managed Gold Partner based in Tulsa Oklahoma.

Recently I have been presenting the lessons we learned while working on a SharePoint Publishing portal that needed to have Multilingual support.

I thought I would also present the material here as well and upload my slides.

 

Introduction

Enabling SharePoint variations on a Publishing Portal allows you to (somewhat) easily create a web application where you can have content pages translated into other languages.

Variations can also be used to provide alternate pages for mobile devices.

 

Planning

Supporting multiple languages should be considered very early in your design process.

Variations effects all aspects of a publishing portal including site structure, lists, master pages, page layouts, document libraries and basically everything.

 

Implementation

A key factor in successfully implementing variations is the patch level of the SharePoint Farm.

The Minimum level that should be used is 12.0.0.6318. This is MOSS 2007 SP1 plus the infrastructure updates for both WSS 3.0 (KB 951695) and MOSS 2007 (KB 951297).

MOSS 2007 SP2 is supposed to improve performance and reliability but I have not yet had a chance to download and test.

If you have Home as your root site, when you turn variations on it will become /EN/Home

Any code that you might be using to create lists, page instances, site structure will need to be variation aware.

Page content is NOT translated.

Variations labels MUST match the culture codes in order for page propagation to work.

Once variations are turned on, you can’t turn them off.

 

Performance

Creating the site hierarchies for the target sites is VERY resource intensive and time consuming. It is recommended that you create only one target site at a time and verify that all of it’s content has propagated prior to creating any additional sites.

You will experience performance problems using variations in a virtual environment, unless that virtual environment very closely mimics physical hardware.

Depending on site size, page propagation times will vary.

 

Lessons Learned

Hidden pages in a pages gallery will be propagated to the target web sites, but they will not be hidden in the target web sites.

Document libraries are not propagated to the target web sites.

If you have a page hidden in the current navigation it will not be hidden in the target web sites.

Changing the default welcome page requires you to reset it on the target web sites.

Source variation lists are not propagated to the target web sites. If the content in the lists needs to be translated for each of the target web sites, you will have to create the lists manually or with code on each of the target web sites.

Only page galleries will be propagated to the target web sites and the pages will be in draft mode.

Using a custom master page on the source site requires you to reset the master page on the target web sites.

Images in the source variation are not propagated to the target sites.

Content types MUST match between page gallery’s in both the source and target web sites.

Changing the default welcome page requires you to reset it on the target web sites.

 

Sample Code

Retrieve all variation labels and iterate over

// Grab all of the variations.
ReadOnlyCollection<VariationLabel> variationLabels = Variations.Current.UserAccessibleLabels;

foreach (VariationLabel vl in variationLabels)
{
   using (SPWeb webSite = siteCollection.OpenWeb("/" + vl.Title + "/AboutUs"))
   {
	// List Creation code omitted …
   }
}
Retrieve all variation labels and iterate over
ReadOnlyCollection<VariationLabel> variationLabels = Variations.Current.UserAccessibleLabels;

foreach (VariationLabel vl in variationLabels)
{
   if (vl.IsSource)
   {
      return vl;
   }
}

Retrieve relative URL for current variation

string currentUrl = SPContext.Current.Web.Url;

ReadOnlyCollection<VariationLabel> variationLabels = Variations.Current.UserAccessibleLabels;

foreach (VariationLabel vl in variationLabels)
{
   if (currentUrl.StartsWith(vl.TopWebUrl, StringComparison.CurrentCultureIgnoreCase))
   {
      variationUrl = "/" + vl.Title;

      break;
   }
}
 
Utilities

It’s possible that the variation relationships can become corrupt. Tim Dobrinski has created a variations editor utility to help fix the relationships list. You can download it from this url.

 

Download the slide deck from here.

 

Hope this helps anybody that is working with variations.

David M. McCollough

No Comments