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

Post about your customizations to share with others.

Moderators: Developer, Contributor

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

Postby corre » Jun 08, 2012 7:29 am

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
corre
 
Posts: 10
Joined: Jun 08, 2012 7:22 am

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

Postby atrol » Jun 08, 2012 1:44 pm

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
Use Mantis2Go to try MantisBT on Windows or to reproduce issues
atrol
 
Posts: 3632
Joined: Mar 26, 2008 4:37 pm
Location: Germany

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

Postby corre » Jun 11, 2012 3:55 am

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
corre
 
Posts: 10
Joined: Jun 08, 2012 7:22 am

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

Postby atrol » Jun 11, 2012 4:47 am

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
Use Mantis2Go to try MantisBT on Windows or to reproduce issues
atrol
 
Posts: 3632
Joined: Mar 26, 2008 4:37 pm
Location: Germany


Return to Customizations

Who is online

Users browsing this forum: No registered users and 0 guests

cron