Export (0) Print
Expand All
Expand Minimize

Localizing the MCMS 2002 Web Author Interface

Content Management Server
 

Microsoft Corporation

June 2003

Applies to:
    Microsoft® Content Management Server 2002

Summary: Learn how to localize the Microsoft Content Management Server Web Author for ASP.NET-based Web sites and ASP-based Web sites. (12 printed pages)

Contents

Introduction
Localizing the Web Author for ASP.NET Web Sites
Localizing the Web Author for ASP Web Sites

Introduction

Microsoft® Content Management Server (MCMS) 2002 includes the MCMS Web Author, a tool that allows multiple users with the appropriate MCMS rights to simultaneously create, update, and approve, and publish Web site content from the Web site itself, making it easy to keep even large Web sites updated with current information.

The Web Author is a Web application that uses server-side and client-side scripting to generate an editable version of existing or new pages. The Web Author console can also be localized so that users of the Web Author can work in their primary language.

This paper describes how to localize the Web Author for ASP.NET-based sites by generating an assembly for each language, and localizing the site content in Microsoft Visual Studio® .NET. For ASP-based sites, this paper describes how to configure the MCMS Content Server to support authoring in multiple languages on the same server, and how to localize the necessary Web Author files.

This paper does not address creating multilingual content. For best practices about creating multilingual content, see the paper on creating multilingual Sites with MCMS 2002 at http://go.microsoft.com/fwlink/?LinkId=14350.

Reader Guidance

This paper is written for developers who are creating MCMS Web sites and need to localize the Web Author so that authors, editors, and moderators can work in a particular language.

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

  • Visual Studio .NET. In particular an understanding of satellite assemblies, assembly linking, resources, resource embedding, .NET cultures, and globalization settings. These are necessary to understand the procedures that describe how to generate assemblies in ASP.NET-based sites.
  • Microsoft Visual C#® development language. This is necessary to understand the sample code that is added to the global.asax file.
  • Microsoft Internet Information Services (IIS) administration. You need to create new Web sites for each language if you are localizing the Web Author in ASP-based sites.
  • Unicode and other character encoding standards. For more information on Unicode, see http://go.microsoft.com/fwlink/?LinkId=14271.
  • For detailed information about MCMS, see the MCMS online documentation located at http://go.microsoft.com/fwlink/?LinkId=9917.

For additional information about localizing .NET applications, see the article, "Best Practices for Developing World-Ready Applications" at http://go.microsoft.com/fwlink/?LinkId=14272.

For more information on .NET CultureInfo codes see Visual Studio .NET Help or go to http://go.microsoft.com/fwlink/?LinkId=14273.

Localizing the Web Author for ASP.NET Web Sites

Before localizing the Web Author you should install and configure MCMS 2002 following the updated installation instructions available at http://go.microsoft.com/fwlink/?LinkId=9917.

There are three steps to localizing the Web Author for ASP.NET sites. These steps are listed below.

  • Step 1: Generate satellite assemblies for certain .dll files (these files are listed in the step). In this step you extract resources from the assembly, localize the resources, and then embed the localized resources back into a satellite assembly.
  • Step 2: Modify certain JavaScript files (the files are listed in the step). Here you must translate the appropriate strings to the language you are localizing to.
  • Step 3: Modify the sample site. In this step you insert code to the sample site global.asax file. This code checks browsers for their language preference.
Note   In MCMS, the Web Author and Authoring Connector components share the same resource DLL file. When you localize the Web Author component, a new resource file is generated and it replaces the resource file provided by the Language Pack. If you want to have both the Web Author and Authoring Connector translated, you need to translate the Web Author and then retranslate the Authoring Connector component. You must retranslate the Authoring Connector component to restore the resource file provided by the Language Pack.
Note   In MCMS 2002 some text strings are displayed as images. This document only provides an explanation of how to modify text, it does not explain how to modify any text string images.

Step 1: Generating Satellite Assemblies

To localize the Web Author for ASP.NET-based sites you must use satellite assemblies. These satellite assemblies only contain resources files; they do not contain any application code. For each culture, or language, that you want to localize the product to, you must create a new satellite assembly containing the resources for that culture.

You must generate the following .dll files:

  • Common.dll
  • Publishing.dll
  • Publishing.Extensions.Placeholders.dll
  • Publishing.Extensions.Placeholder.Office.dll
  • Web.dll
  • WebAuthor.dll
  • WebAuthor.Resource.dll
  • WebControl.dll

The instructions below show you how to localize the Web Author by generating the first assembly from the above list, the Common.dll assembly. There are three procedures to this step:

  1. Converting the .dll assembly file to a readable resource file (.resx)
  2. Localizing the resources in Visual Studio .NET
  3. Embedding the localized resources back into a satellite assembly

To convert the Common.dll assembly file to a readable resource file (.resx)

  1. Click Start, point to Programs, point to Microsoft Visual Studio.NET, point to Visual Studio .NET Tools, and then click Visual Studio .NET Command Prompt.
  2. At the command prompt, type the path to the Common.dll file in the product installation directory as follows:
    cd <drive>:\Program Files\Microsoft Content Management Server\Server\bin
    

    Press Enter.

  3. At the command prompt, type the following code:
    ildasm Microsoft.ContentManagement.Common.dll 
    /out:Microsoft.ContentManagement.WebControls.il /utf-8
    

    Press Enter. This command extracts the resources from the WebControls.dll and places them in the current directory.

  4. At the command prompt, type the following code:
    resgen Microsoft.ContentManagement.Common.StringResources.resources 
    Microsoft.ContentManagement.Common.StringResources.<.NET CultureInfo>.resx
    

    Press Enter. The resources are now converted to a .resx file. You localize the .resx file using Visual Studio .NET as explained in the following procedure.

    <.NET CultureInfo> is the culture name of the language you want to localize to. For example, for a French version of the Web Author you would type fr.

  5. Keep the Microsoft Visual Studio.NET Command Prompt window open. Proceed to the next procedure, "To localize the resources in Visual Studio .NET."

To localize the resources in Visual Studio .NET

After you have generated a .resx file, you localize it using Visual Studio .NET.

  1. Click Start, point to Programs, point to Microsoft Visual Studio .NET, and then click Microsoft Visual Studio .NET.
  2. In the File menu, point to Open, and click File. Locate the .resx file that you created in the previous procedure (step 4).
  3. In the Data section under the value column, translate all the values to your language preference. For example, replace "Switch to Edit Site" with the French translation.
  4. In the File menu, click Save All.

After you have localized the .resx file, you convert the .resx file back to an assembly file as shown in the following procedure.

To embed the localized resources back into a satellite assembly

  1. To convert the localized .resx file back to a satellite assembly, return to the Visual Studio .NET Command Prompt window. At the Visual Studio .NET prompt, type the following code:
    resgen Microsoft.ContentManagement.Common.StringResources.<.NET CultureInfo>.resx 
    

    Press Enter.

    Note   <.NET CultureInfo> is the name of the language you want to localize to. For example, for a French Web Author you would type fr.
  2. At the command prompt, type the following code:
    sn –e Microsoft.ContentManagement.Common.dll mspublickey.snk
    

    Press Enter. This extracts the MCMS public key.

  3. At the command prompt, type the following code:
    al /t:lib /culture:< .NET CultureInfo> 
    /embed:Microsoft.ContentManagement.Common.StringResources.<.NET CultureInfo>
    .resources /v:5.0.1200.0 /delay+ 
    /keyfile:mspublickey.snk /out:Microsoft.ContentManagement.Common.resources.dll
    

    Press Enter. This generates the satellite assembly.

  4. At the command prompt, type the following code:
    sn -Vr  Microsoft.ContentManagement.Common.resources.dll
    

    Press Enter. This registers the satellite assembly for verification skipping.

  5. At the command prompt, type the following code:
    gacutil /if Microsoft.ContentManagement.Common.resources.dll
    

    Press Enter. This installs the satellite assembly in the Global Assembly Cache (GAC).

  6. At the prompt, type iisreset, and then press Enter.

    This reloads the MCMS application.

You have now created a satellite assembly for the Common.dll and installed it in the global assembly cache.

Repeat these procedures for the remaining .dll assemblies:

  • Publishing.dll
  • Publishing.Extensions.Placeholders.dll
  • Publishing.Extensions.Placeholder.Office.dll
  • Web.dll
  • WebAuthor.dll
  • WebAuthor.Resource.dll
  • WebControl.dll

You must repeat all the procedures in this step for all of the above.dll satellite assemblies for each culture you want to localize to.

Step 2: Modifying JavaScript files

Next you must translate the strings in certain JavaScript files that the Web Author uses. There are five JavaScript files you must localize. The following table lists the files and their locations.

JavaScript File Location
EopModifyClient.js <install drive>:\Program Files\Microsoft Content Management Server\IIS_CMS\WebAuthor\Dialogs\PropertiesDialogs
JavaScriptUIStrings.js <install drive>:\Program Files\Microsoft Content Management Server\IIS_CMS\WebAuthor\Client
PageRevisionHistory.js <install drive>:\Program Files\Microsoft Content Management Server\IIS_CMS\WebAuthor\Dialogs\RevisionBrowser
PageRevisionInfo.js <install drive>:\Program Files\Microsoft Content Management Server\IIS_CMS\WebAuthor\Dialogs\RevisionBrowser
SelectionFrame.js <install drive>:\Program Files\Microsoft Content Management Server\IIS_CMS\WebAuthor\Dialogs\InternalLinks

To translate the JavaScript files

  1. Click Start, point to Programs, Point to Microsoft Visual Studio .NET, and then click Microsoft Visual Studio .NET.
  2. In the File menu, point to Open, click File, and browse to the location of the first JavaScript file.
  3. Modify all the strings to the language you are localizing to.
  4. From the File menu, click Save <JavaScript file.js>.
  5. From the File menu, click Exit.
  6. Repeat these steps for each of the JavaScript files listed in the above table.

Step 3: Modifying the Sample Site

It is recommended you modify the sample site by adding the following code to the global.asax.cs file. This code checks a browser to determine the language preference. Adding this code dynamically changes the interface of the Web Author to the same language that the user has set in their User Locale setting in Windows. If the user language is not available in the set of resources, the language setting defaults to English.

For more information, see the Knowledge Base article (Q306162) "How to Set Current Culture Programmatically in an ASP.NET Application" at http://go.microsoft.com/fwlink/?LinkId=14280.

To modify the sample site

  1. Click Start, point to Programs, point to Microsoft Visual Studio .NET, and then click Microsoft Visual Studio .NET.
  2. In the File menu, point to Open, click File, and browse to <drive>:\Program Files\Microsoft Content Management Server\Sample Data\WoodgroveNet.sln.

    This opens the WoodgroveNet solution.

  3. In the Solution Explorer - WoodgroveNet pane, double-click Global.asax.
  4. In the Global.asax.cs window, click the link, Click here to switch to code view.
  5. In the Global.asax.cs window, at the section that begins with "void Application_BeginRequest(Object sender, EventArgs args) " you can cut and paste, or type the following code into your file, or modify this code suit your needs:
    {
          // For each request initialize the culture values with
          // the user language as specified by the browser.
          if (Request.UserLanguages != null)
          {
                for (int i = 0; i < Request.UserLanguages.Length; i++)
                {
                      string strLanguage = Request.UserLanguages[i];
     
    // Note that the languages other than the first are in 
    //the format of
                      // "<Language>;<q=<weight>>" (e.g., "en-us;q=0.5")
                      if (strLanguage.IndexOf(';') >= 0)
                      {
                            strLanguage = 
    strLanguage.Substring(0, strLanguage.IndexOf(';'));
                      }
     
                      try
                      {
    Thread.CurrentThread.CurrentCulture = 
    CultureInfo.CreateSpecificCulture(strLanguage);
                            break;
                      }
                      catch (Exception)
                      {
    // Some cultures are not supported and will cause an exception to 
    // throw.  In this case, 
    // we ignore the exception and try the next culture based on client 
    // language preference.  
    // Note that if no culture can be set properly, then the default 
    // culture will be used.
                      }
                }
          }
     
    // Set the CurrentUICulture also so that all the resources loaded using 
    // Resourcemanager use this culture  
          Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
     
    }
     
    
  6. From the File menu, click Save Global.asax.cs.
  7. From the Build menu, click Build Solution.

    This recompiles the file.

  8. From the File menu, click Exit.

Localizing the Web Author for ASP Web Sites

The MCMS Web Author can also be localized for ASP-based Web sites. To localize the Web Author in ASP-based Web sites you need to configure your server to allow for multiple language authoring.

The server configurations described in this paper are intended for testing purposes only and have not been scaled for use in a production environment. In a large-scale MCMS implementation, this server configuration could be used for the back-end authoring server, with a standard build read-only MCMS server for the end user. For more information about scaling MCMS, see "Planning for Deployment" in MCMS 2002 Help.

Before localizing the Web Author you should install and configure MCMS 2002 following the updated installation instructions available at http://go.microsoft.com/fwlink/?LinkId=9917.

This paper assumes the following:

  • You are using the Default Web Site, Administration Web Site, or have created a new Web site for hosting the MCMS server
  • You are using the Default Web Site, Administration Web Site, or have created a new Web site as the MCMS Server Configuration Application (SCA) entry point.

The following steps are required to localize the Web Author for ASP-based Web sites:

  • Step 1: Adding a Web Site for a Second Language
  • Step 2: Using the SCA to Enable Authoring
  • Step 3: Creating Independent IIS_NR Folders for Each Web Site
  • Step 4: Configuring the NR Virtual Directories for Each Web Site
  • Step 5: Localizing the UIStringConstants

Step 1: Adding a Web Site for a Second Language

The default Microsoft Internet Information Services (IIS) configuration creates a Default Web Site and an Administration Web Site when you install MCMS 2002. In addition to these Web sites you must also add another site(s) using IIS for each language that you want to author in.

You need a different IP address for each language. Assign the IP addresses different domain name service (DNS) names so that authors can easily distinguish them. For more information on creating Web sites see the IIS 5.0 Help.

To add a Web site

  1. Click Start, point to Programs, point to Administrative Tools, and then click Internet Service Manager.
  2. In the left pane of the Internet Service Manager, right-click the computer name, point to New, and then click Web Site.
  3. Click Next to continue.
  4. In the Description box, type a name for the virtual site and then click Next.
  5. In the IP Address and Port Settings page, enter a unique IP address or a unique TCP port or host header.
    Note   For more information about IP addresses and ports, see the IIS 5.0 Help.
  6. In the Web Site Home Directory page, type the path to the Web site home directory. Use the same home directory as the default Web site, which by default is <drive>:\Inetpub\wwwroot, where <drive> is the drive letter where Windows 2000 Server (or XP) is installed.
  7. In the Access Permissions page, accept the default permissions, and then click Next.
  8. On the Complete page, click Finish.

Once you have created a new Web site for each language, proceed to "Step 2: Using the SCA to Enable Authoring."

Step 2: Using the SCA to Enable Authoring

Use the MCMS Server Configuration Application (SCA) to enable authoring on the new language Web site by granting read/write access so that authors, editors, and moderators can publish content to the site.

To enable content authoring

  1. Click Start, point to Programs, point to Microsoft Content Management Server, and then click Server Configuration Application.
  2. On the Web tab, click Configure.
  3. In the MCMS? column, select Yes-Read Write to enable authoring for the Web site that you created in the preceding procedure.

    A message appears indicating that MCMS will stop and restart the affected Web sites. To continue, click OK.

  4. To close the Web Server Configuration page, click OK.
  5. To close the SCA, click Close Application.

MCMS creates a virtual directory named NR for the new language authoring site. You can use Internet Services Manager to view this new NR virtual directory. You are now ready to move to "Step 3: Creating Independent IIS_NR Folders for Each Web Site."

Step 3: Creating Independent IIS_NR Folders for Each Web Site

Now that you have a new Web site for each new language and have enabled authoring, you create an independent IIS_NR folder for each Web site. In the following example, one is created for the English language site, and one for the French language site.

To create independent IIS_NR folders for each Web site

  1. Copy the IIS_NR folder from the <install drive>:\Program Files\Microsoft Content Management Server\Server folder to the <install drive>:\Inetpub folder. You might rename this folder IIS_NR_EN for an English language site.
  2. Copy the IIS_NR folder from the <install drive>:\Program Files\Content Management Server\Server folder to the <install drive>:\Inetpub folder. You might rename this folder IIS_NR_FR for a French language site.

Once you have created the folders for each Web site, you are ready to move to "Step 4: Configuring the NR Virtual Directories for Each Web Site."

Step 4: Configuring the NR Virtual Directories for Each Web Site

You must configure the NR virtual directories in IIS for each Web site to use the appropriate NR folder, which you created in the preceding step. For more information about virtual directories see IIS 5.0 Help.

To configure the NR virtual directories

  1. Click Start, point to Programs, point to Administrative Tools, and then click Internet Services Manager.
  2. Expand the computer name and then expand the Default Web Site.
  3. Right-click the NR virtual directory for the Default Web Site, and then click Properties.
  4. In the NR Properties dialog box, in the Local Path box, type <install drive>:\Inetpub\IIS_NR_EN, and then click OK.
  5. In the Internet Information Services window, expand the second language Web site.
  6. Right-click the NR virtual directory for the second language Web site and click Properties.
  7. In the NR Properties dialog box, in the Local Path box, type the path to the virtual directory for the second language. For example you might type, <install drive>:\Inetpub\IIS_NR_FR.

After you complete the configurations for the NR virtual directories for each Web site, see "Step 5: Localizing the UIStringConstants."

Step 5: Localizing the UIStringConstants

The final step is to localize the UIStringConstants to the language of your preference. The files you must modify are listed below.

  • All files (there are two) in the UIStringConstants folder located in <install drive>:\Inetpub\IIS_NR_<new language folder>\System\WBC\Customizable\SiteEmbeddedWBCLinks\UIStringConstants
  • All the files (there are 17) located in the UIStringConstants folder located at <install drive>:\Inetpub\IIS_NR_<new language folder>\System\WBC\Customizable\WBCFuncPagesConfig\UIStringConstants

Note that these files are located in the in the language-specific folder you created. For example, for the first set of files, the English folder you created in step 3 would be in: <install drive>:\Inetpub\IIS_NR_EN\System\WBC\Customizable\SiteEmbeddedWBCLinks\UIStringConstants and the French files would be in <install drive>:\Inetpub\IIS_NR_FR\System\WBC\Customizable\SiteEmbeddedWBCLinks\UIStringConstants.

You modify SiteModeUIStrings.inc and WBCConsoleUIStrings.inc to the respective language in the corresponding directories and then specify the localized string.

For example, to localize "Switch To Edit Site" you do the following:

  1. Open SiteModeUIStrings.inc in <install drive>:\Inetpub\IIS_NR_FR\
    System\WBC\Customizable\SiteEmbeddedWBCLinks\UIStringConstants
    .
  2. Find the line, Const IDS_UI_SWITCH_TO_EDITSITE = "Switch To Edit Site".
  3. Replace "Switch To Edit Site" with its localized string.

This completes the steps to localize the Web Author for ASP-based Web sites.

Show:
© 2014 Microsoft