Because Tuleap is used by a large community of users, it is internationalized. For now, available languages are:

  • English
  • French

Thus, there shouldn’t be any untranslated words or sentences of natural language in source code. This applies to any strings displayed to end users (web, emails). Logs or system messages are in english.

Internationalization is available in two different ways. The legacy one, based on .tab files, and the new one, based on gettext.


Gettext system documentation

In core

echo _('Homepage');

In plugins

We use the domain feature provided by gettext in order to have i18n in plugins.

echo dgettext('tuleap-proftpd', 'File');


The command xgettext extracts strings without being able to interpret PHP constants or variables. Don’t try to be too smart and don’t put the domain tuleap-proftpd in a variable or a constant, we need to repeat ourselves.


You can use localized strings from core or other plugins (beware of dependencies!) in a given plugin.


echo sprintf(
        "The field '%s' doesn't exist",
        "The fields '%s' don't exist",
    implode("', '", $nonexistent_fields)
// The field 'summary' doesn't exist
// or
// The fields 'summary', 'details' don't exist


Pluralization is only available for plugins as of today.

In PHP .mustache files

In order to not pollute your presenters, you should use gettext directly in the .mustache files:

<!-- In core -->
<h1>{{# gettext }}Personal page{{/ gettext }}</h1>
  {{# ngettext }}
    There is %s apple
    | There are %s apples
    | {{ count }}
  {{/ ngettext }} <!-- There are 2 apples -->
  {{# ngettext }}
    The user with id %s has been removed from %s
    | The users with id [%s] have been removed from %s
    | {{ count }}
    | {{ comma_separated_ids }}
    | {{ project_name }}
  {{/ ngettext }} <!-- The users with id [123, 456] have been removed from GuineaPig -->

<!-- The same in plugins by giving the domain with dgettext and dngettext -->
<h1>{{# dgettext }} tuleap-agiledashboard | Scrum backlog {{/ dgettext }}


As we are using | as separator, you cannot use it in your strings (and there is no way to escape it for now, contribution welcomed if you really need it).


  1. Add a new localizable string.
  2. Run make generate-po. This will update corresponding .pot files that are templates for your localization files.
  3. Edit localization files in site-content/fr_FR/LC_MESSAGES/tuleap-xxxx.po with your favorite editor (poedit is fine).
  4. Once you have localized your sentences, run make generate-mo (some editors, like poedit, generate .mo files for you). You may need to restart your webserver (docker exec tuleap-web /etc/init.d/rh-php56-php-fpm restart).
  5. Refresh your browser, and voilà!


If you are introducing gettext in a plugin, you must touch plugins/<name>/site-content/tuleap-<name>.pot and mkdir plugins/<name>/site-content/fr_FR before calling make generate-po.

Furthermore you must declare your domain in the constructor of your plugin. For example, for tracker plugin, in trackerPlugin.class.php:

bindtextdomain('tuleap-tracker', __DIR__.'/../site-content');


On our dev setup (tuleap-aio-dev) you must ensure that “fr_FR” locale is installed (locale -a). If it is not the case, run localedef -i fr_FR -f UTF-8 fr_FR.UTF-8.

.tab files

This system is based on a key/value pair. PHP code references a key (actually a primary and a secondary keys) which is replaced by the full sentence, according to the user preferences.

Language files are available in the site-content/ directory, for example site-content/en_US/include/ The same file exists for the french version: site-content/fr_FR/include/

These language files follow a defined syntax:

key1 [tab] key2 [tab] translated string

and sentences are separated by a carriage return. Keys are split in different files for convenience, but are “compiled” in a big unique file at execution.


include_exit        error   An error occured

The class that manages i18n is BaseLanguage (src/common/language/BaseLanguage.class.php). It is initialized by pre.php, and language is set according to the user preferences. This php code will return the matching string defined in language files:

$GLOBALS['Language']->getText('include_exit', 'error'));