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

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
corre

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

Post 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
atrol
Site Admin
Posts: 8575
Joined: 26 Mar 2008, 21:37
Location: Germany

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

Post by atrol »

Code: Select all

if ( lang_get_current() === 'english' ) {
    $s_test = 'english.......';
} else {
    $s_test = 'other language .......';
}
Please use Search before posting and read the Manual
corre

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

Post 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
atrol
Site Admin
Posts: 8575
Joined: 26 Mar 2008, 21:37
Location: Germany

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

Post 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.
Please use Search before posting and read the Manual
Post Reply