Translation tables

 

Translation tables are used to convert the data provided by the application to the format that will not conflict with specification. Usually the application returns the data as-is. However what if template requires some characters to be escaped or encoded?

 

Example: the application will return multiple lines of data delimited with CRLF. However in HTML document such formatting must be changed to <br> tag. Translation tables are designed to convert results of macro substitutions automatically. This way when new template with new formatting is added, the application doesn't have to be modified - template will do the job itself.

 

Translation table is included to template inside <params> tag as follows:

 

<#params>

 

<#translation name="Translation_Table_Name" default="True">

 

   <#replace string="string1" with="string2"/>

 

   <#replace string="string1">string2<#/replace>

 

   <#replace string="string1" with="stri">ng2<#/replace>

 

<#/translation name="Translation_Table_Name">

 

<#/params>

 

Table consists of one or more replace tags with parameters. Each replace tag specifies a sequence of characters to be replaced and a sequence of characters to be used as a replacement.

 

There can be more than one translation table in the template. In this case all tables must have different names and "default" parameter for exactly one table must be set to true.

 

 

See also:

       Template language overview

       Loops

       Conditions

       Macros

       Comments

       Parameters

 

 


Time Tracker - Download - Buy now