Multilingual User Interface in Page Layouts and Master Pages

December 1, 2011

On the 30th of November I went the Biwug sessions about SharePoint 2010 Multilingual User Interface. It were very interesting sessions that gave a good overview of variations, language packs, resource files, …

Based on what I heard in this sessions, I wanted to make a small addition related to the branding process and MUI.

When you create master pages or page layouts, you can create content specific HTML blocks. These language specific content blocks can easily be created with a SharePoint Control called: LanguageSpecificContent.

A container control that renders content conditionally based on the language code of the current Web site (SPWeb). MSDN

This means that the control checks the language in which the site has initially been created. So nothing will happen when the language gets changed from within the user context menu. But this solution can be used when you have a publishing site with language variations enabled.

Usage

To use this SharePoint Control, the following assembly needs to be registered on your master page or page layout (this is referenced by default).

1
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

The next step is to create your language specific content, this can be done as follows.

1
2
3
4
5
<SharePoint:LanguageSpecificContent runat="server" Languages="LCID">
  <ContentTemplate>
    ...
  </ContentTemplate>
</SharePoint:LanguageSpecificContent>

In the Languages attribute you could specify the language code (locale identifier: LCID). You can insert your language specific content between the ContentTemplate tags.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<SharePoint:LanguageSpecificContent runat="server" Languages="1033">
  <ContentTemplate>
    [EN] Text
  </ContentTemplate>
</SharePoint:LanguageSpecificContent>
<SharePoint:LanguageSpecificContent runat="server" Languages="1043">
  <ContentTemplate>
    [NL] Tekst
  </ContentTemplate>
</SharePoint:LanguageSpecificContent>

On an English site you get this:

English Specific Content
English Specific Content

On a Dutch site you get this:

Dutch Specific Content
Dutch Specific Content

Comments

comments powered by Disqus