Skip to main content
Skip table of contents

Translations (i18n properties)

You can use translation strings for your email template for internationalization. This will become handy if your Confluence is used by people with different languages.

How to create translation properties?

Translation properties are configured in the Email Translations section in the Task Reminder Email Template configuration. Properties have the following format:

CODE
LANGUAGE_CODE.some.arbitrary.property.key

Language codes are taken from the official ISO 639-1 specification. For example, an English property is specified as:

CODE
en.some.property.key=This is an English property value. It will be used for users who have their language set to English in their profile

The according French property would be:

CODE
fr.some.property.key=C'est une valeur immobilière française. Il sera utilisé pour les utilisateurs dont la langue est définie sur le français dans leur profil.

You can also specify a default property that will be used if no property for a user's language code is specified:

CODE
some.property.key=This is a default property value which will be used if no property for the user's language code is specified.

What language will be used?

Translations found in your template content will be replaced with the version specified for each email recipient's language.

The language will be read from what each user configured in their user profile:

Note: we currently don't support sub-codes like en_GB or en_US but only the language specifier (in this case en). If you desire sub-codes for your instance, please let us know with a feature request!

How do I use the translation I specified in my template?

Translation strings are included in the template content using the Task Reminder helper's getText method, e.g. $TR.getText("some.property.key"). Note that no language key must be specified in the argument string, because the language is resolved automatically from the user profile of each recipient!

Here is an example with a simple template using translations:

CODE
<h2>$TR.getText("email.heading")</h2>

<p>
    $TR.getText("email.intro")
</p>

#if ($tasks.expired.activated)
    <h4>$TR.getText("heading.expired")</h4>
    #if($tasks.expired.size() > 0)
        ## ...
    #else
        <p>$TR.getText("message.notasks.expired")</p>
    #end
#end

#if ($tasks.expiringSoon.activated)
    <h4>$TR.getText("heading.expiringsoon")</h4>
        ## ...
    #else
        <p>$TR.getText("message.notasks.expiringsoon")</p>
    #end
#end

## ... the same for $expiringLater and $withoutDueDate

<p><a href="$baseUrl/plugins/inlinetasks/mytasks.action">$TR.getText("manage.my.tasks")</a></p>

This could be the respective translations (in English):

CODE
en.email.heading=Task Reminder - Your Tasks for Today!
en.email.intro=Hey! There are a few tasks that need your attention...
en.heading.expired=Expired Tasks (please take care of these!)
en.message.notasks.expired=There are currently no expired tasks.
en.heaging.expiringsoon=Tasks Expiring Soon
en.message.notasks.expiringsoon=There are no tasks expiring soon.

# ...the same for expiringLater and withoutDueDate...

en.manage.my.tasks=Manage my tasks

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.