Product SiteDocumentation Site

Chapter 7. Customizing MantisBT

7.1. Strings / Translations
7.2. Custom Fields
7.2.1. Overview
7.2.2. Custom Field Definition
7.2.3. Adding/Editing Custom Fields
7.2.4. Linking/Unlinking/Ordering Existing Custom Fields in Projects
7.2.5. Localizing Custom Field Names
7.2.6. Dynamic default values
7.2.7. Dynamic values for Enumeration Custom Fields
7.3. Enumerations
7.4. Email Notifications
7.5. Customizing Status Values
7.6. Custom Functions
7.6.1. Default Custom Functions
7.6.2. Example Custom Function Override

7.1. Strings / Translations

All strings used in MantisBT, including those defined in plugins, can be customized or translated differently. This is achieved by overriding them in the Custom Strings File (in config/custom_strings_inc.php), which is automatically detected and included by MantisBT code.
Defining custom strings here provides a simple upgrade path, and avoids having to re-do the changes when upgrading to the next release.
Two formats are supported within this file:
New Format
Define a $s_custom_messages array as follows:
$s_custom_messages = array( LANG => array( CODE => STRING, ... ) );
Legacy Format
One variable per string
$s_CODE = STRING;
Where
  • LANG = language code, as defined in $g_language_choices_arr (see Section 5.10, “Language”)
  • CODE = string code, as called by lang_get() function.
  • STRING = string value / translation

Note

Mixing old and new formats within the file is not supported.

Warning

NEVER call lang_get_current() from the Custom Strings File, as doing so will reset the active_language, causing the code to return incorrect translations if the default language is different from English. Always use the $g_active_language global variable instead.