Show navigation | Frontpage | Contact us | Sitemap

Multiple languages in Composite

Composite natively supports multiple languages and allows webmasters and editors to manage language specific versions of pages, xhtml templates, images, XSL etc.

This document briefly describes how to add and manage languages in Composite.

Adding languages while creating the site

The Composite “Create new site” wizard will prompt you for a list of languages to install on the site. This selection will define the sites language list. XHTML templates, XSLT sources etc. will be automatically created for each language selected. By default most content will be in English and might require localization.

An autonomous sub site is automatically created for each language, named “(language name) Homepage”. Each sub site contains a search page, sitemap and news area.

When an editor creates a new page the language setting is automatically inherited from the “mother page”. The editor can easily override this selection if desired.

Adding languages on an existing site

Once a site has been created, adding new languages to the site is done by executing a database script. The script requires information about the new language to add (LCID and language name, like“1030” and “Danish”) and the LCID of an existing language to copy XHTML templates and XSL from.

You can find a list of LCID codes here: /content/composite_developer/3x_technologies/front-end/intrinsic_indentifiers/writelcid/lcid_list

Remember to take a backup...

We recommend that you take a backup of your database before you execute the "add new language" script.

Step one, execute the script

The script can be obtained by contacting our support department.

When executed the script will add the new language to the sites language list and generate the needed XHTML templates and XSL by copying the data from the source language.

Step two, create the new sub site

The database script will not create any actual pages. To create a new sub site with the newly added language, the user must have Composite administrative privileges and execute the following steps:


  1. Create a new page in a temporary location (like below the current home page)
  2. Using the mouse, drag the icon of the newly created page above the current homepage – a horizontal line above the title indicates that you are about to drop the dragged page above the marked page.
  3. Use drag and drop again to move the original home page back to the top again. This step in important, since the top most home page is regarded as the default home page.
  4. Click the title of the new page (selecting it) and press the user group icon from the toolbar above the Pages tree. In the work area a form containing user groups appear. Select the user groups that should have access to the page and save.

At this point a sub site with the new language has been created – containing a single page. You can add new pages or copy existing pages from another sub site (using drag and drop, while holding down the CRTL key). If you copy a page, you need to edit it and change the language selection.

Customizing XHTML templates and XSLT sources

On the “Templates” tab you can see the XHTML templates for the site. When you edit a template you will get a tab for each language on the site – if your XHTML templates contains any text that need to be localized, you can make the changes here.

The XSLT sources for the site is located on the “Datamap” tab, below “Data Query XSL Definitions”. Like the XHTML templates, the XSL here has separate sources for each language. If a function need to be localized, you can make the changes here.

Giving access to the different language versions

If your site contains different language versions, you can use different options to guide the user to the appropriate page.

English (or other) as the default language

The page located at the top most position in the “Pages” tree is the default start page, and this page will be shown when the URL of a user request has no path, and the host name part is not bound to another page. In other words, if you don’t change anything, all requests without a path specified will go to this page.

You can use this behavior to present all your visitors with an English (or other) version, and then guide them to their desired localized sub site by following as link (like “Deutch sprache” etc.). You can these links to the templates.

Selecting sub site based on the URL path

You can combine the strategy described above with a path based approach, where you use the path portion of the Friendly URL field (located on the Access tab when editing a page).

If you specify a Friendly URL path like “dk” on the Danish homepage, you can access the page using http://www.contoso.com/dk (where www.contoso.com is the host name of your site).

This is an easy way to distribute a language specific URL to customers etc. without having to obtain different domain names (like www.contoso.dk)

Selecting sub site based on the URL host name

If your organization has multiple domain names with language specific extensions (like www.contoso.com and www.contoso.dk etc.) you can utilize this by writing the appropriate host name in the “Friendly URL” field on the localized homepage.

The host name match algorithm uses a “best match, right to left” strategy. This means that you can specify “contoso.com” as host name and Composite will use this page for all requests where the host name ends with “contoso.com” – including “www.contoso.com“. You can even shorten the host name to “.com”.

Remember to configure DNS and IIS

Please note that you should configure DNS and IIS to “point” the host name to your Composite site. Configuring the host name element in Composite alone will not do the trick.

My modules


© 2008 Composite A/S, Danmark
Tlf: +45 39 15 76 00 | info@composite.net
Composite A/S er Microsoft Certified Partner
Composite CMS overholder standarden for valid CSS
Composite CMS overholder standarden for valid XHTML 1.0
Printet fra http://www.composite.net/composite-1620.htm
Findes på denne sti: Composite Developer | 3.x technologies | Configuration | Multiple languages in Composite