Translations for custom fields

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
illes
Posts: 30
Joined: 09 Mar 2005, 08:37
Location: Budapest, Hungary

Translations for custom fields

Post by illes »

Could someone help me where to define to translations of the custom field titles?

Thanks,
Illes
vboctor
Site Admin
Posts: 1293
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Post by vboctor »

When the titles for custom fields are shown, the following rule is used:
- If there is a string with the custom field name in the locatisation files, it will be used.
- Otherwise, the name will be used as the title.

Typically, custom field names will not be in the standard localisation files. Also we don't want to edit the distribution files to make the upgrade easier. The proper way to do this is to add these strings to custom_strings_inc.php.

An example of adding such custom strings can be found at http://manual.mantisbt.org/manual.custo ... values.php.

Regards,
Victor
MantisConnect
http://www.futureware.biz/mantisconnect
illes
Posts: 30
Joined: 09 Mar 2005, 08:37
Location: Budapest, Hungary

Thanks for your help, but

Post by illes »

I was already aware that custom_strings_inc.php have to be used, but I would like to know the variable name of the custom fields (e.g. "Date/Time Found")!

Thanks,
Illes
vboctor
Site Admin
Posts: 1293
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Post by vboctor »

If you have a custom field with the name "Date/Time Found", you should rename it to "date_time_found", use the php variable "$s_date_time_found", and set this variable to "Date/Time Found" by default. You can override the value to a localised value for the languages that you want to support.

Regards,
Victor
MantisConnect
http://www.futureware.biz/mantisconnect
illes
Posts: 30
Joined: 09 Mar 2005, 08:37
Location: Budapest, Hungary

Post by illes »

Thanks a lot, now it's clear.
vboctor
Site Admin
Posts: 1293
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Post by vboctor »

I have added a post to my blog that summarises this thread:
http://www.futureware.biz/blog/index.ph ... &tb=1&pb=1

Regards,
Victor
Mantis to Go?
http://www.futureware.biz/mantisconnect
sergeyol
Posts: 4
Joined: 12 Apr 2018, 09:51

Re: Translations for custom fields

Post by sergeyol »

Is it also possible to specify the translation for enumeration values in this way?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Translations for custom fields

Post by atrol »

Please use Search before posting and read the Manual
sergeyol
Posts: 4
Joined: 12 Apr 2018, 09:51

Re: Translations for custom fields

Post by sergeyol »

Thanks for quick help.

So, for example, if I have a custom field named "approval_state", I should create two strings for each language:

Code: Select all

$s_approval_state = "Approval State";
$s_approval_state_enum_string = "10:new,20:waiting for approval,30:approved";
Is it the way it works for custom enums?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Translations for custom fields

Post by atrol »

Translation of enumeration values is possible.

Translation of custom field enumeration values is not possible because of https://www.mantisbt.org/bugs/view.php?id=5636
Please use Search before posting and read the Manual
Post Reply