Building a Multilingual Site Using Content Management Server

For the latest information, see https://www.microsoft.com/cmserver

On This Page

Introduction Introduction
Planning for a Multilingual Web Site Planning for a Multilingual Web Site
Considerations when Creating a Multilingual Site Considerations when Creating a Multilingual Site
Building a Multilingual Web Site with MSCMS Building a Multilingual Web Site with MSCMS
Summary Summary
Appendix A Appendix A

Introduction

Web sites have increasingly become more sophisticated in how they distribute information to millions of people around the world. The challenge is how to ensure those sites get information out in a timely, efficient manner to a number of different audiences—even in different languages—all without sacrificing content and the dynamic capability of the site.

Microsoft Content Management Server 2001 (MSCMS) can take site content and make it relevant to whatever context in which it is being presented. As a Web content management system, MSCMS can reduce costs; yet still maintain accuracy through an efficient workflow process by delivering personalized content for multiple audiences, devices, and purposes.

This paper examines how to use MSCMS when creating a multilingual site. It gives a brief overview of what's involved in planning a multilingual site, such as translation and workflow notification requirements, and what elements you need to consider for your site, such as code pages, character sets, fonts, and the appropriate MSCMS API methods.

This paper explains how to build a multilingual site using one of the three available methods—template switching, master and subordinate sites, and parallel sites.

Reader Guidance

Readers of this paper should have a working knowledge of the following:

  • Creating templates, channels, folders, custom properties, and connected pages

  • Mapping folders and channels

  • Unicode and other character encoding standards (for more information on Unicode, see https://www.unicode.org/)

For detailed information about the concepts in MSCMS, see the MSCMS online documentation located at https://www.microsoft.com/CMServer/techinfo/.

Planning for a Multilingual Web Site

It is essential that you plan for your multilingual Web site from the outset. Every organization will have different requirements, but there are a few common considerations. For example:

  • Decide if the translation of your content will be done internally or externally. This will have an impact on the workflow of your site.

  • Address any encoding issues, such as using UTF-8 for all languages or native code pages for each language. You need to know this when you design the templates for each language.

  • Address any legal issues that may arise in countries/regions where you plan to deploy your site. For example, some countries/regions have strict privacy policies that restrict the collection of personal data.

  • Address any cultural issues. There may be information on your site that is offensive or confusing in certain cultures.

In addition to these issues you also need to understand workflow implications. MSCMS can take care of a certain amount of the workflow of your site with notifications, but different organizations have different needs that impact how they choose to deploy their sites. Therefore, workflow notifications, including translation notifications, are set based on the structure of the organization. The following table outlines three possible scenarios.

Template

Site Structure

Deployment

Company A

Single templates that handle all languages for the site.

All sites should follow the site templates and have the same content.

Worldwide launch of the site.

Company B

Master templates for the site with presentation templates for subsidiary languages.

Each subsidiary runs its own site, but uses the master template for consistency. Sites may include content from the main office, but information is tailored to specific regions.

Worldwide launch of the site.

Company C

Independent site templates.

Each subsidiary has its own independent site.

Each subsidiary may deploy at different times.

Production approval and translation workflow may be different depending on an organization's structure. For example, Company A and B must ensure all translation and approvals are complete prior to launching the site. Incorporating appropriate workflow hooks and notifications are necessary for these organizations. This paper briefly describes the workflow in each method of creating multilingual sites, but for more detailed information, see the MSCMS white paper "Extending the Workflow Model," which is available on https://msdn.microsoft.com.

Considerations when Creating a Multilingual Site

MSCMS is ideal for building multilingual sites because the dynamic publishing model makes building flexible and dynamic presentation easy through its complete feature sets. Authors can enter content using any language that is part of the Unicode 3.1.1 standard, and site developers can easily change the Web Author interface to present commands in the language of their authors.

Unicode is a unified encoding scheme for character sets that considers all major writing systems. Unicode allows you to support a single page with different languages without any loss of data. Even though the database is stored in Unicode, you can output any encoding. You can also create and deploy all your sites from one server.

When creating a multilingual site, you must make basic choices about the code pages, character set, and fonts that you will use on your site. You must also consider which Publishing API methods you will use to access the code pages and character sets.

Code Pages

The code page is how Internet Information Services (IIS) knows what languages you are trying to use. It translates what is in the MSCMS server repository so the browser will understand what language you are using. Code pages can cover more than one language, and some Unicode-based code pages even support all major written languages. Code pages are an important consideration when building multilingual sites because it is what MSCMS uses to convert dynamic strings from Unicode.

In IIS the code page must be specified in the template itself and not in an include file in order to handle authoring properly. Code pages are set at the top of an ASP page. For example, <%@ Codepage=932@ %> is the Japanese code page.

Character Sets

The character set you use on your site tells the user's browser how it is supposed to get the information from the server. The character set value is set in the HTML meta tag using the HTML template. It should be set to the same language as your code page. The following code sample represents the Japanese character set.

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=shift_jis">

Remember that universal character sets (UTF-8) are available in Microsoft Internet Explorer 4 and later. However, there are no guarantees that everyone will be able to use it since UTF-8 browsers are not as widely used in some countries/regions outside North America.

Fonts

When choosing the fonts for your MSCMS template, remember to choose a font that matches the character set for the language you are using. For example, Arial does not contain Japanese characters. You should create a style guide for each language that indicates the fonts, font size, and attributes (such as bold or italic) you want to use on your site.

Publishing API

The Publishing API can be called from any scripting language supported by ASP, including server-side Jscript and Microsoft® Visual Basic® Scripting Edition (VBScript). The API provides interfaces to postings and channels within an MSCMS database. To access code pages and character sets from the API you can use the following methods:

  • template.codepage, posting.codepage, channel.codepage

  • template.charset, posting.charset, channel.charset

MSCMS Web Author uses these methods to let you edit and store pages.

For more information about the MSCMS API methods, see the "MSCMS 2001 Publishing API Help" that shipped with the product CD or go to https://www.microsoft.com/CMServer/techinfo/.

Building a Multilingual Web Site with MSCMS

After you have taken the appropriate steps to plan your site, you can then proceed with creating it by editing new or existing templates in MSCMS. To enable new or existing templates to support multilingual authoring in both MSCMS Site Builder and Web Author, remember the following:

  • Template designers must edit the template HTML to change the supported fonts and character sets.

  • Authors and editors must use the DisplayName property so that navigation links appear in a language other than English. Template designers use the DisplayName property for their navigation links. MSCMS supports the DisplayName property for postings, channels, and resources. You must set custom properties for each language on your site, but the DisplayName property should be in the primary language. This is particularly important if you have multiple languages on a single page.

Once you enable a template for a language, this means:

  • Placeholder objects are fully readable and editable in that language.

  • All standard authoring and editing functions, such as copying, pasting, importing, saving, deleting, previewing, and publishing can be done in any language, if that language is installed on the server.

  • All aspects of the user interface embedded in the site (for example, Console and SiteMode Switch) and the navigation can be displayed in any language, if that language is installed on the server.

There are three methods in MSCMS you can use to create a multilingual site. These methods are:

  • Template switching

  • Master and subordinate site pages

  • Parallel sites

Template Switching

Template switching involves redirecting from one template to one or more alternate templates. The main template is assigned to a posting and contains the code for switching to alternate templates based on certain conditions.

Alternate templates are customized to suit a specific switching condition. Therefore, for multilingual sites, one of your alternate templates could be designed for Japanese and another for Greek.

Template switching is invisible to content creators. However, this method does complicate the template script. Template switching is ideal when you only have two or three additional languages, and when you maintain a simple navigation structure for your site.

When working with alternate templates, you should keep in mind the following:

  • Alternate templates must have a unique name throughout the template gallery.

  • Any property accessible using server-side or client-side scripting can be used as a switch condition.

  • The main template must be assigned to a posting.

  • Do not implement a switch in edit mode.

  • Alternate templates must use the same placeholder names for placeholders that share content, as shown in the following figure.

multi01

To implement template switching, do the following:

  1. Create the channel structure for each language.

  2. Create the folder structure for each language.

  3. Create templates for all the languages you want for your site.

  4. Set custom properties for the main template and indicate which template you will use for each language. You connect to your alternate templates through these custom properties, so be sure to use standard naming conventions in the custom properties.

  5. Write a script using the MSCMS API object Autosession that indicates when template switching should occur. The Autosession object supplies a method for getting a URL of a current posting by using the alternate template.

    When a switching template is requested by a subscriber's browser, it runs an If statement in the server-side ASP to determine if a specified browser property is True (for example, if the user is running Internet Explorer 4). If one of the conditions is a match, a call is made to the URLUsingAlternateTemplate method of the AutoSession.inc file, passing it the name of the alternate template to switch to. This performs a server-side redirect to the alternate template.

    The Autosession property supplies a method for getting a URL of a current posting by using the alternate template:

Autosession.URLUsingAlternateTemplate(templatename)

  1. The template switching is done in the code of the template. Therefore, if you want to switch from an English template to a Japanese template you set your code as follows:

uaString = cstr(request.ServerVariables("HTTP_USER_AGENT")) If Japanese User Then 'find the right template customproperties = autosession.thisposting.customproperties jpTpltName – customproperties.item("jpTemplate").value 'find its URL JPpltURL = Autosession.URLUsingAlternateTemplate(jpTpltName) 'redirect to this page using new template Response.redirect jpTemplateURL End if

  1. The switching logic of this code at run time indicates when a posting using the main template is requested by a Web browser, the code in the switching template evaluates the conditions set out by the template designer and either displays the main template or switches to one of the alternate templates, in this case, the Japanese template.

Approval and workflow notification is done in template switching when new content is added to each template. Notifications are sent to the appropriate language editors and moderators for approval.

Master and Subordinate Site Pages

Another method for creating multilingual sites is to create a master page with subordinate pages. This method is the most complex of the three methods, but it allows content creators to work in one place with a single master channel, which means a simpler workflow. The master sites contain all the placeholders for every language in the site.

The master and subordinate method for creating multilingual sites is best used when most of the content is in all mirror channels, and when you are working with sites of no more than three languages.

To create master and subordinate site pages, do the following:

  1. Create the channel structure for every language in your site. The channel structure for each language must be identical.

  2. Create the folder structure only for the master templates.

  3. Map all the channels to the master folder.

  4. Create templates for all the languages you want for your site. Placeholders must have the same name as what you named them in the master template.

  5. Set custom properties in the master templates. You connect to your subordinate templates through these custom properties. From the master template indicate which template you will use for each language. Use standard naming conventions in the custom properties.

  6. Make customizations to MSCMS Web Author by setting the PostingOpHook script. By doing this, when you enter content in the authoring channel, a connected posting in the language channel is also created. See Appendix A in this white paper for the PostingOpHook sample script.

  7. Set the WorkflowHook script to handle posting approvals. By doing this all the corresponding language pages are approved. See Appendix A in this white paper for the WorkflowHook sample script.

All approval and publication workflow is done on the master pages only. This means all translation must be done prior to publishing the page.

Parallel Sites

The third method for creating multilingual sites is to create parallel sites. Parallel sites consist of individual templates and channels for each language on your site. The challenge with parallel sites is individually managing each site for each language.

Parallel sites are similar to master and subordinate sites except that mirroring the channel structure is not necessary since there is no master site and you do not have to make modifications to the template script. Unlike template switching and master subordinate sites, parallel sites work well for sites with more than three languages because the impact on performance is limited.

To create parallel sites, do the following:

  1. Create the channel structure for every language in your site. The channel structure for each language must be identical.

  2. Create the folder structure for every language in your site. The folder structure for each language must be identical.

  3. Map all the channels to their corresponding folders.

  4. Create templates for all the languages you want for your site.

With parallel sites you have separate channels, but you can have connected pages in each channel. For example, the English channel may have a page with a placeholder for the title, body content, and an image. The Japanese channel has a page that has the same placeholders as the English page, but the image placeholder is shared. This way, if the image is ever changed, both sites will be updated simultaneously.

The workflow is more complex with parallel sites because you need to manage each template. In each site, when content is added or modified, it must go to the appropriate language editor for approval and then to the appropriate language moderator. If it is appropriate for your site, use connected pages to reduce some of the management tasks since shared content is automatically updated. This can help reduce workflow complexity since all connected pages are approved simultaneously.

Summary

Planning your multilingual site before you begin creating it is an important step in deciding what issues you need to address for your particular organization. After you have determined what translation, encoding, legal, and cultural issues you must incorporate into your site structure, you can begin creating or modifying your site.

The three methods for building multilingual sites, template switching, master and subordinate site pages, and parallel sites are appropriate in different circumstances. Understanding the structure of your organization, how your site will be deployed, and the number of languages you need to include, will help you make a good decision as to which method will work best for you.

Appendix A

PostingOpHooks

PostingOpHooks.inc contains hook functions called before and after a posting is created, saved, or deleted. Use the OnBeforeXYZ hook functions to cancel an operation and/or some conditions.

<%
' -----------------------------------------------------------------------------
'Create variable to get around timing issues when creating connected postings
Dim m_bCreatedPosting
m_bCreatedPosting = False
' -----------------------------------------------------------------------------
'
'	 This is the hook function being called after a simple posting has 
'	 just been created.   
'
'	 @pNewPosting [in] - the new Posting object that has just been created.
'
' -----------------------------------------------------------------------------
Sub OnAfterCreatePosting( pNewPosting )
 m_bCreatedPosting = True
End Sub
' -----------------------------------------------------------------------------
'
'	 This is the hook function being called after a simple/connected posting has 
'	 just been updated.   
'
'	 @pPosting [in] - the Posting object that has just been updated.
'
' -----------------------------------------------------------------------------
Sub OnAfterUpdatePosting( pPosting )
'	 If this is the first time the posting is updated, we want to create some connected postings.
 If (m_bCreatedPosting = True) Then
 	 Call CreateMLSPostings( pPosting )
 End If
End Sub
Sub CreateMLSPostings( pBasePosting )
 ' Custom Script:
 '   Create Connected Postings in language specific Channels. 
 ' The following naming schemes will need to match placeholder 
 ' names in the Master Authoring Template
 Const IDS_NEWSCONTENT_PH_PREFIX = "NewsContent_"
 Const IDS_DISPLAYNAME_PREFIX = "DisplayName_"
 ' The following naming schemes will need to match CustomProperties 
 ' names in the Master Authoring Template	 
 Const IDS_CHANNEL_EOP_POSTFIX = "_Channel"
 Const IDS_TEMPLATE_EOP_POSTFIX = "_Template"
 ' Iterate through placeholders and look for ones named with prefix "NewsContent_"
 For Each pPlaceholder In pBasePosting.Placeholders
 	 If Left( pPlaceholder.Name, Len(IDS_NEWSCONTENT_PH_PREFIX) ) = IDS_NEWSCONTENT_PH_PREFIX Then
 	 	 Dim strLangID
 	 	 ' found placeholder named "NewsContent_", determine the language ID by looking at its
 	 	 ' remaining characters (should be 2 chars)
 	 	 strLangID = Right( pPlaceholder.Name, Len(pPlaceholder.Name) - Len(IDS_NEWSCONTENT_PH_PREFIX) )
 	 	 ' just make sure strLangID is a 2 capital letter code
 	 	 If (Len( strLangID ) = 2) And ( UCase(strLangID) = strLangID ) Then
 	 	 	 Dim strDestChannelPath, strTemplatePath
 	 	 	 Dim pPlaceholder, pTemplate, pChannel, pConnectedPosting
 	 	 	 Dim pFormReader
 	 	 	 ' determine Channel and Template path from CustomProperties, given LangID
 	 	 	 strDestChannelPath = pBasePosting.Parent.CustomProperties.Item( strLangID & IDS_CHANNEL_EOP_POSTFIX )
 	 	 	 strTemplatePath = pBasePosting.CustomProperties.Item( strLangID & IDS_TEMPLATE_EOP_POSTFIX )
 	 	 	 ' try to get Channel and Template Object
 	 	 	 Set pChannel = AutoSession.Searches.GetByPath( strDestChannelPath )
 	 	 	 Set pTemplate = AutoSession.Searches.GetByPath( strTemplatePath )
 	 	 	 ' ready to create new Connected Posting if both Channel and Template is available
 	 	 	 If Not ((pChannel Is Nothing) Or (pTemplate Is Nothing)) Then
 	 	 	 	 Set pConnectedPosting = pChannel.CreateConnectedPosting( pTemplate, pBasePosting )
 	 	 	 	 If Not (pConnectedPosting Is Nothing) Then
 	 	 	 	 	 ' Set DisplayName afterwards, reading from form submitted value 
 	 	 	 	 	 ' Note that this field is just an input field on the Template and 
 	 	 	 	 	 ' is NOT a placeholder
 	 	 	 	 	 Set pFormReader = GetInitializedFormReaderSafe( False )
 	 	 	 	 	 pConnectedPosting.DisplayName = pFormReader.Form(IDS_DISPLAYNAME_PREFIX & strLangID)
 	 	 	 	 	 ' CommitAll to set transaction boundary so that each iteration's
 	 	 	 	 	 ' success/failure is independent
 	 	 	 	 	 Call AutoSession.CommitAll()
 	 	 	 	 End If
 	 	 	 End If
 	 	 End If
 	 End If
 Next
End Sub
%>

WorkflowHooks

WorkflowHooks.inc contains hook functions called before and after a posting is submitted, approved, or declined. Use the OnBeforeXYZ hook functions to cancel an operation.

<%
' -----------------------------------------------------------------------------
'
'	 This is the hook function being called after a certain workflow opertaion
'	 has just been performed on some Posting. 
'
'	 @pPosting [in] - the Posting object that has just been put through the
'	 	 	 	 	 workflow operation.
'
'	 @strAction [in] - indicates the type of workflow operation that has just 
'	 	 	 	 	 been performed. Its possible values are: 
'	 	 	 	 { IDS_ACTION_SUBMIT, IDS_ACTION_APPROVE, IDS_ACTION_DECLINE }
'
' -----------------------------------------------------------------------------
Sub OnAfterWorkflowOp( pPosting, strAction )
 ' This function is called after a workflow operation is performed on
 ' the passed in Posting. The implementation of this Sub is totally
 ' up to the site designer. The following is just a suggested implementation
 ' to start with.
 If strAction = IDS_ACTION_APPROVE Then
 	 Call ApproveLanguageSpecificConnectedPostings( pPosting )
 End If
End Sub
Sub ApproveLanguageSpecificConnectedPostings( pPosting )
 Const IDS_MASTER_TEMPLATE = "MasterTemplate"
 ' check if this is a Template tagged as a Master authoring Template
 If (pPosting.CustomProperties.Item( IDS_MASTER_TEMPLATE ) = "True") Then
 	 Dim pLangSpecificPosting 
 	 For Each pLangSpecificPosting In pPosting.ConnectedPostings
 	 	 Call pLangSpecificPosting.Approve()
 	 	 ' make each approval an independent transaction by CommitAll()
 	 	 Call AutoSession.CommitAll()
 	 Next
 End If
End Sub
%>