Configuring System Text in RTF Report Templates
In order to enable the translation of a report's field labels and column headings into the language of the user's locale, the RTF report template uses placeholders instead of hard-coding the text. The placeholder is the code to an item of configurable system text.
For example, a table that shows a Site's Certificates, such as:
Type | Certificate No. |
---|---|
EC Licence Number |
123456 |
Organic Certification |
987654 |
May be coded in the RTF template as:
orseReports.type | orseReports.certificateNo |
---|---|
F description |
referenceCertNo E |
Where orseReports.type is the key to the system text for the Type label, and orseReports.certificateNo is the key for the Certificate No. label.
System Text Translations
When coded accordingly, the report run by an English user would present the table as:
As Sold
Attribute | Red | Amber | Green |
---|---|---|---|
|
|
|
|
And run by a French user would present the table as:
Non préparé
Attribut | Rouge | Ambre | Vert |
---|---|---|---|
|
|
|
|
Duplicated Text
If the RTF template contains multiple occurrences of item of text, such as Product Attributes for As Sold and As Consumed values, each with Red, Amber, and Green column headings, the placeholders must contain unique values, typically by appending an incrementing number, such as:
orseReports.asSold
orseReports.attr | orseReports.red | orseReports.amber | orseReports.green |
---|---|---|---|
F description |
red |
amber |
green E |
orseReports.asConsumed
orseReports.attr_2 | orseReports.red_2 | orseReports.amber_2 | orseReports.green_2 |
---|---|---|---|
F description |
red |
amber |
green E |
If a placeholder is not unique, when the report is run, the first occurrence of the placeholder will show the appropriate system text, but subsequent occurrences will just show the placeholder name, such as:
As Sold
Attribute | Red | Amber | green |
---|---|---|---|
|
|
|
|
As Consumed
orseReports.attr_2 | orseReports.red_2 | orseReports.amber_2 | orseReports.green_2 |
---|---|---|---|
|
|
|
|
Note:
An alternative to using an incrementing numeric suffix as above, is to use a descriptive differentiator to form a unique placeholder, such as orseReports.asSoldRed and orseReports.asConsumedRed.
If the portal operates just a single language and there is no requirement for translations, the fixed text could simply be hard-coded, however the use of placeholders is recommended, as it allows for changes to system text, and the introduction of languages without the need to rebuild report templates.
The system text must be on its own line, and must not include any spaces, tabs, or other characters:
Correct | Incorrect |
---|---|
"orseReports.totalChargedCost" |
"orseReports.totalChargedCost " |
"orseReports.totalChargedCost : " |
|
orseReports.totalCost: 999,999.00 |
orseReports.totalCost: 999,999.00 |
orseReports.totalChargedCost: 999,999.00 RS |
orseReports.totalChargedCost: 999,999.00 RS |
If a new item of system text needs to be created to cater for a duplicate reference, the process described in Configuring System Text and XLIFF for Reports is used.