mantisbt:localizing_custom_fields_labels
Differences
This shows you the differences between two versions of the page.
Next revisionBoth sides next revision | |||
mantisbt:localizing_custom_fields_labels [2006/09/23 01:55] – created vboctor | mantisbt:localizing_custom_fields_labels [2008/10/29 04:25] – (old revision restored) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Localizing Custom Fields Labels ====== | ||
+ | Following is the recipe for customizing the labels for custom fields. | ||
+ | |||
+ | * Give the custom field a valid variable name | ||
+ | For example, for a start date custom field, name it " | ||
+ | |||
+ | * Localize the word " | ||
+ | Mantis provides a technique to add localized strings or update existing ones without having to modify the language files. The reason for that is to avoid having your modifications overwritten when you install the next version of Mantis. | ||
+ | |||
+ | The way to do that is to create custom_strings_inc.php and place it in the main folder of Mantis. The implementation of this file should look similar to the following: | ||
+ | |||
+ | <code php> | ||
+ | if ( lang_get_current() == ' | ||
+ | $s_my_start_date = 'Start Date XX'; | ||
+ | } else { | ||
+ | # Default (use your preferred language as the default) | ||
+ | $s_my_start_date = 'Start Date'; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Note that the above code must be inside a PHP block. | ||
+ | |||
+ | If the $s_my_start_date happened to be a stock string in Mantis that is already localised in the standard files, then you do not need to do this extra localisation work. For example, if the field name was " |
mantisbt/localizing_custom_fields_labels.txt · Last modified: 2019/01/14 06:02 by dregad