Skip to content

Translate (.$)

If you would like to translate a mentioned taxonomy option of an information when it is being printed on a document, refer to it using .$ instead of ..

Warning

A .$ reference is replaced by the label only when the document or page is rendered, so a string function that reads the characters of its argument works on the reference rather than on the label. SPLIT finds no separator in it, REPLACE finds no character to replace and LEN counts the reference. Pass a .$ reference only to CONCAT, JOIN, FORMAT and TRIM, which combine it without reading it and leave it to be translated per request.

Example: Simple

To print "CITY, COUNTRY" of an entity in the request language on a document a calculated information with the following RuLa expression is created:

e is Entity
e.city + ", " + e.$country

The first part, e.city, prints the city of the entity as usual. The second part, e.$country, though references the country in a way that the name of the country is translated into the requested language when the document is created. So when a user requests the document in german, this would print e.g. Berlin, Deutschland, when requested in English Berlin, Germany.

Example: Creating an Address

The following expression would put a printable address into a calculated information:

p is Person
JOIN(
    [
        p.street_and_number,
        p.postal_code + ' ' + p.city,
        p.$domicile
    ], 
    '\n'
)