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

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
karl.reichert
Posts: 38
Joined: 02 Apr 2009, 12:22

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

Post 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.
Mantis: 1.2.1
OS: Windows Server 2003 R2
WampServer 2.0g-1 [03/12/09]
Includes :
- Apache 2.2.11
- MySQL 5.1.36
- PHP 5.2.11
karl.reichert
Posts: 38
Joined: 02 Apr 2009, 12:22

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

Post 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?
Mantis: 1.2.1
OS: Windows Server 2003 R2
WampServer 2.0g-1 [03/12/09]
Includes :
- Apache 2.2.11
- MySQL 5.1.36
- PHP 5.2.11
atrol
Site Admin
Posts: 8542
Joined: 26 Mar 2008, 21:37
Location: Germany

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

Post 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)
Please use Search before posting and read the Manual
karl.reichert
Posts: 38
Joined: 02 Apr 2009, 12:22

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

Post 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.
Mantis: 1.2.1
OS: Windows Server 2003 R2
WampServer 2.0g-1 [03/12/09]
Includes :
- Apache 2.2.11
- MySQL 5.1.36
- PHP 5.2.11
Post Reply