RT can be configured to run in a variety of languages and has a lot of support internally for internationalization.
10.7.1. How RT's I18N FrameworkI18N Framework
Most of the text generated by RT is localized, except for log messages. Depending on what type of code you are writing, there are a few different ways to access RT's localization functions.
Inside a modulesuch as a script condition or overlayRT offers the
, there is a globally available function
which does the same thing. If you want to localize a piece of inline text inside a component, you can wrap it in a filtering component call, like this:
This calls a Mason component that runs your text through an I18N filter and outputs the result.
10.7.2. Writing Internationalized Code
Whenever you generate a piece of text to be presented to the end
, you should use RT's I18N framework. Under the hood, RT uses
to implement I18N.
To specify the string to localize,
, which is a mini-templating system. When localizing a string, you often need to
. For example, if you want to localize "Found 6 tickets," you want to make the number of tickets found a variable. In bracket notation that would be
the I18N system that the first parameter is some quantity of tickets. This allows it to properly
"ticket." The first part of the notation,
, is shorthand for the
Complete documentation of this notation can be found in the documentation for
, and there are plenty of examples of its usage in the RT
10.7.3. Localizing RT
Each localization of RT is contained in a single
file installed under
. These files simply contain pairs of strings as found in the source, and their translated versions. For example, in the French translation,
, we can see:
msgid "Group has no such member"
msgstr "Un tel membre n'appartient pas au groupe"
is what is passed in the call to the localization method, and the
is the translated version.
RT comes with a utility to generate an empty message catalog for a new translation. Simply run the script
from the root of your RT installation and give it the filename for the new catalog you would like created.
The new catalog will create a new empty catalog, along with comments indicating where each
comes from, as in the above example.
This script is not installed in a normal RT installation, but it is available from the source tarball.