Page 1 of 1

Unable to localize string values of a custom field of type e

Posted: 08 Jun 2012, 12:29
by corre
HI

I use 2 languages: french and english
In custom_strings_inc.php i have localized the name of the fields
according to the langage by writing : $s_test = "......."
I don't know to localize custom fields values.

Thanks

Re: Unable to localize string values of a custom field of ty

Posted: 08 Jun 2012, 18:44
by atrol

Code: Select all

if ( lang_get_current() === 'english' ) {
    $s_test = 'english.......';
} else {
    $s_test = 'other language .......';
}

Re: Unable to localize string values of a custom field of ty

Posted: 11 Jun 2012, 08:55
by corre
I know to localize a custom field but how to localize the contents of a custom field.
For example:
if data_type is enum type: "bathymetry|velocity|tide"
It's ok to
if ( lang_get_current() === 'english' ) {
$s_data_type = 'Data type';
} else { if ( lang_get_current() === 'french') {
$s_data_type = 'Type de données';
}

but "bathymetry|velocity|tide" i don't know to localize

Thanks

Re: Unable to localize string values of a custom field of ty

Posted: 11 Jun 2012, 09:47
by atrol
Have a look at http://www.mantisbt.org/docs/master-1.2 ... DS.DYNAMIC
Something like the function custom_function_override_enum_mine is what you need.

But I fear you will not get what you expect.
Be aware that MantisBT stores the value (for example "bathymetry") of custom fields.