Page 1 of 1

Is it possible to change strings on a per project base?

Posted: 04 Jun 2010, 09:15
by karl.reichert
I have the following states globally for all projects in config_inc.php:

Code: Select all

$g_status_enum_string = '9: new internal bug,10:new,15:requirement changed,20:reopened,25:in analysis,28:analysed,30:in discussion,40:in planing,50:in progress,60:solved,70:in verification,75:testcase creation,78:testcase review,79:verification failed,80:verified,85:no bug,90:closed';
They are translated the following way in custom_strings_inc.php:

Code: Select all

$s_status_enum_string = '9:neuer interner Fehler,10:neu,15:geänderte Anforderung,20:Wiederaufnahme,25:in Analyse,28:analysiert,30:in Klärung,40:in Einplanung,50:in Arbeit,60:gelöst,70:in Verifikation,75:Testfall wird erstellt,78:Testfall wird gereviewt,79:Verifikation fehlgeschlagen,80:verifiziert,85:kein Fehler,90:geschlossen';
In project XYZ, I want to change the translation of some of the states' strings.

So I changed the configuration via webinterface:
Image

After saving, it looks fine:
Image

However, strings remain unchanged for this project, e.g. for state 9 there is still "neuer interner Fehler" instead of "a" displayed.

Am I doing something wrong? Or is it not possible to change the translations on a per project base?

If so, I would have to add a few new states and set appropriate translations for these new states. But this will fill the list of states more and more and is not a nice way, because in generally I'm satisfied with my states, just want to have a different translation for different projects.

Re: Is it possible to change strings on a per project base?

Posted: 04 Jun 2010, 13:30
by karl.reichert
I found a blog entry by Victor, which describes, how strings can be changed on a per project and even a per view base. However, the way it's described there, is not working, because bug_get_field() and project_exists() (the latter one is called by function helper_get_current_project()) are not available in current MantisBT versions, as it seems. Anyone knows if there are similar functions or what else I could try?

Re: Is it possible to change strings on a per project base?

Posted: 06 Jun 2010, 15:49
by atrol
karl.reichert wrote: bug_get_field() and project_exists() (the latter one is called by function helper_get_current_project()) are not available in current MantisBT versions, as it seems.
I found bug_get_field in file bug_api.php (line 1241 in version 1.2.1) and project_exists in file project_api.php (line 186 in version 1.2.1)

Re: Is it possible to change strings on a per project base?

Posted: 07 Jun 2010, 08:22
by karl.reichert
atrol wrote:
karl.reichert wrote: bug_get_field() and project_exists() (the latter one is called by function helper_get_current_project()) are not available in current MantisBT versions, as it seems.
I found bug_get_field in file bug_api.php (line 1241 in version 1.2.1) and project_exists in file project_api.php (line 186 in version 1.2.1)
I now included the files and the example is working! I will now go on customizing my strings. Thank you very much for your help!

I also wrote a bug for the missing includes.