This attribute defines some text part that must be translated using PHPTAL's translation system.

<div i18n:translate="string:welcome_message">Welcome here</div>

In the above example, PHPTAL will looks for a translation key named 'welcome_message' and will replace the content of the tag with the equivalent in currently requested language.

<div i18n:translate="">Welcome here</div>

This usage is a little different, no translation key is given, thus PHPTAL will use the content of the tag 'Welcome here' as the translation key. This is a regular translation if translation system knows the key 'Welcome here'.

If no translation is found, the key will be used as the translation result. That's why using readable message instead of keys may be a good choice.

Please note that the key to translate may be contained in a variable, to allow dynamic key selection.

<div tal:define="welcome random_welcome_message">
  <div i18n:translate="welcome"></div>