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 (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.

Note

The standard MantisBT language strings are sometimes reused in different contexts. If you are planning to override some strings to meet your specific requirements, make sure to analyze where they are used to avoids unexpected issues.
Format
$s_CODE = STRING;
Where
  • CODE = string code, as called by lang_get() function. Search in lang/strings_english.txt for existing codes.
  • STRING = string value / translation

Warning

NEVER call lang_get_current() from the custom_strings_inc.php, 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.