Websydian v6.1 online documentationOnline documentation - WebsydianExpress v3.5

Templates and Language Support - Examples

Overview

The following examples will show how you can convert a site to handle a multi-language environment.

It will also describe how the runtime will use the created folder list to determine which template to use to generate a page.

Base case

A site contains two folder lists "General" and "Customer".

The folder list "General" is the default folder that is assigned to most users.

The folder list contains one folder:

 

1. General

 

The folder list "Customer" is only assigned to users who belong to a specific customer. For this customer, the WebsydianExpress application is shown as part of the customer's intranet - and so a number of templates and style-sheets have been customized to fit the customer's design.

The folder list contains two folders:

 

1. Customer

2. General

 

As the application has not been language specific before, all of the folders has *Base assigned as the language.

 

Language dependent folders and folder lists

The application must now support both an English and a German version. The first thing to do is to create the two languages in the site - this opens the possibility to assign languages to the folders.

 

Firstly, four new folders must be created - one for each language for each existing folder.

This means that there now are 6 different folders:

General - *Base

General - English

General - German

Customer - *Base

Customer - English

Customer - German

 

When you translate any of the templates in one of the *Base folders, you place the translated template in the corresponding language dependent folder. In this way, you will always have the original template in the *Base folder - and if you have a translation, it will be found in the language dependent folder.

 

The translated folders are added to the two folder lists according to the following two recommendations:

1. Position the *Base version of a folder last on the folder list.

2. Group the translation folders by type not language - as shown for the folder list Customer below.

Applying these rules results in the following content of the folder lists:

 

Folder list General:

1. General - English

2. General - German

3. General - *Base

 

Folder list Customer:

1. Customer - English

2. Customer - German

3. Customer - *Base

4. General - English

5. General - German

6. General - *Base

 

It is not important whether the English versions come before the German versions - but it is important that all language dependent versions of a folder are placed before the *Base version of the folder.

Finding a template

Overview

When a PageGenerator is called in a WebsydianExpress application, the name of the template file that will be used to generate the HTML page is found based on the presentation specified for the business process that is being executed.

After this, the runtime will go through each folder in the folder list that either has the same language as the current session or has *Base as folder language.

 

For a German-speaking user, who belongs to the special customer so that he uses the Customer folder list, the following folders will be searched:

1. Customer - German

2. Customer - *Base

3. General - German

4. General - *Base

 

For a customer, who has no language specified, the following folders will be searched:

1. Customer - *Base

2. General - *Base

 

For an English-speaking user the following folders will be searched:

1. General - English

2. General - *Base

 

Example 1:

You have a template "MyTemplate.htm". The original version of this template is found in the General - *Base version.

 

You have now included the template in the other folders:

1. An English translation of this template has been included in the General - English folder.

2. A German translation of this template has been included in the General - German folder.

3.A customer specific version has been included in the Customer - *Base folder (This is the un-translated template that fits the customer's design).

3a. An English version of the Customer specific template has been included in the Customer - English folder.

3b. A German version of the Customer specific template has been included in the Customer - German folder.

 

As you can see, the template MyTemplate.htm can be present in each of the folders.

Applying the rules for finding the templates will result in:

1. A request from a German user from the special customer will find the template in the Customer - German folder.

2. A request from an English user from the special customer will find the template in the Customer - English folder.

3. A request from the special customer with no language specified will find the template in the Customer - *Base folder

4. An ordinary German user will find the template in the General - German folder.

5. An ordinary English user will find the template in the General - English folder.

6. An ordinary user with no language specified will find the template in the General - *Base folder.

7. If you define French as a language, and assign French to a user, he will find the templates in the same places as users with no language until you add French folders to the folder lists.

 

Example 2:

In example one the template has been translated to both English and German, and there is a special custom specific version of the template - also in all three languages.

Another example could be that there is not a special custom specific version - and that only an English translation has been made.

In this case, the template will only be present in two different folders:

1. In the General - *Base folder.

2. In the General - *English folder.

 

In this case:

1. All German users will find the template in the General - *Base folder.

2. All English users will find the template in the General - English folder

3. All other users will find the template in the General - *Base folder.

 

Example 3:

Now if a German translation of this template is made and placed in the General - German folder:

1. All German users will find the template in the General - German folder.

2. All English users will find the template in the General - English folder

3. All other users will find the template in the General - *Base folder.