Return to last viewed topic Go to previous topic Go to next topic
Send us documentation feedback Technical support Learning Center Print topic

Multi-Language Support


Creating Web Pages that Support Several Languages

When thinking about setting up your Web site to support content in multiple languages, consider these three actions.
Action
For more information, see
Create language-specific content blocks, menus, collections
After you create these items, have the page invoke that item dynamically using an appropriate function (such as ecmContentBlock). When Ektron CMS400.NET receives a request to display an item that includes a language and item id number, it returns the language-specific edition. To learn about letting the user select a language from a Web page, see Viewing Your Site in Another Language.
Adjust template content to user language
Translate text in images

Modifying Page Content Based on Language Selection

If a template's text should change according to a user's language selection, use a case statement to provide the language-specific content. A good example of this is the template used on the RC international sample site (Illustrated below).

Assume you want to create editions of the menu that runs across the header (Home, Products, etc.) in three languages:

To do so, follow these steps.


Note

This procedure uses the header.asp file delivered with the RC international sample site as an example.


  1. In the template file, declare each menu option a variable. For example:
Dim t_search, t_products, t_support, t_news, t_careers, t_calendar, t_home, t_login,  t_site_lang, t_contact, t_copyright, calendar_id 
  1. Enter case statements that provide the value of each variable in each language. (1031 is the decimal code for German, 1036 for French.) The following illustrates how to do this for the search menu option.
Select Case ContentLanguage 
	Case "1031" 
		t_search = "Suche" 
	Case "1036" 
		t_search = "Recherche" 
	Case else 
		t_search = "Search" 
End Select 

Now, when a user visits a page controlled by this template and selects French or German as the site language, the page is refreshed and the translated values appear on the template.

Modifying Images Based on Language Selection

Many Web page templates also include images that require translation. You can set up templates to invoke images in the user-selected language by following these steps.

  1. For each supported language, create a folder within your Web site's images folder. Name each folder according to the language's decimal id value (for example, German is 1031). See Also: Appendix A: List of Supported Languages

If your site supports English, don't forget to create a folder named 1033.

  1. Copy all images to each language-specific folder.
  2. Within each folder, translate the text on each image but do not change its name.


Warning!

If you change an image's name, this procedure will not work.


  1. Wherever the image is referenced in your template or Web page, replace the current reference with this:

img src="images/<%= Contentlanguage %>/image name"

For example:

img src="images/<%= Contentlanguage %>/companylogo.jpg"

When a visitor to your Web site selects a language then navigates to the page with the image, the Contentlanguage variable comes into play. It uses the visitor's language selection value to identify the folder that contains images in that language. That image then appears on the page.

To continue the above example, if a user views the site in German, the code that invokes the image translates to this:

img src="images/1031/companylogo.jpg" 

Send us documentation feedback Technical support Learning Center Print topic Return to last viewed topic Go to previous topic Go to next topic