A separate scripts_english.txt for a specific project?

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
Hsoj
Posts: 14
Joined: 05 Apr 2005, 19:32

A separate scripts_english.txt for a specific project?

Post by Hsoj »

I'm trying to find a solution for getting a specific project to use different language strings than the rest of the projects.

The reason for this is that we want to use Mantis for both bug and task tracking, but within separate projects. If the user is viewing a Tasks project, I want to flavor everything so that instead of "Report Issue" they see "Add Task," and so on and so on.

My original solution was to go into the strings_english.txt and do one of these jobs:

Code: Select all

$currentproject = helper_get_current_project();

if ($currentproject == 7) {

[language strings for task tracking]

}

else {

[language strings for bug tracking]

}
The problem here was that using the helper_get_current_project(); didn't always work on every page. For example, if a user clicks on a direct link to a bug from an email, it would just go straight to an application error:
Warning: 300 in /usr/local/apache2/htdocs/mantis/core/lang_api.php on line 223

APPLICATION WARNING #300:

SYSTEM WARNING: Cannot modify header information - headers already sent by (output started at /usr/local/apache2/htdocs/mantis/core/lang_api.php:223)

SYSTEM WARNING: Cannot modify header information - headers already sent by (output started at /usr/local/apache2/htdocs/mantis/core/lang_api.php:223)
Also, obviously, various pages such as the login page would have NO project selected at the time.

So my question is, does anyone know of an easy way to get at what I'm trying to do? Getting the project ID before listing the strings seems to be the best way to do it, but I don't know how to handle it when there may not be ANY project selected at the moment.

Any help would be greatly appreciated. Thank you very much :)
vboctor
Site Admin
Posts: 1293
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Post by vboctor »

Try using the custom strings file. Also only get the current project for the strings that are dependent on the project, rather than all strings. These strings will typically appear on the pages where the current project is known.

Regards,
Victor.
Post Reply