RT5.0.7 Modify/Translate RT main menu

Hello !

I’d like to modify a few items in the RT, RTIR menu to suit our specific needs.

For example, I’d like to replace the “Incident Report” sub-menu with “Signalement d’Incident” in the “RTIR” menu. The same goes for “Countermeasures”, which I’d like to replace with “Contre-mesures”.

image

Do you have any idea how I could do this?

For information, I’m on RT 5.0.7 and RTIR 5.0.6

Hi,

This info seems comming from the file:
/opt/rt5/local/plugins/RT-IR/html/Callbacks/RTIR/Elements/Tabs/Privileged

Look at the “loc(‘something’)” values.

Dont forget to purge the cache and reload
rm -rf /opt/rt5/var/mason_data/obj && service apache2 restart

I dont know if you can make it “patch resistant” with a callback or an overlay.

$root->child(
    incidents => title => loc('Incidents'),
    path => '/Search/Results.html?ExtraQueryParams=RTIR&RTIR=1&Lifecycle='.RT::IR->lifecycle_incident,
)->child(
    create => title => loc('Create'),
    path => RT::IR->HREFTo('Incident/Create.html?Lifecycle='.RT::IR->lifecycle_incident, IncludeWebPath => 0),
);
$root->child(
    reports => title => loc('Incident Reports'),
    path => '/Search/Results.html?ExtraQueryParams=RTIR&RTIR=1&Lifecycle='. RT::IR->lifecycle_report,
)->child(
    create => title => loc('Create'),
    path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_report, IncludeWebPath => 0),
);
$root->child(
    investigations => title => loc('Investigations'),
    path => '/Search/Results.html?ExtraQueryParams=RTIR&RTIR=1&Lifecycle='.RT::IR->lifecycle_investigation,
)->child(
    launch => title => loc('Launch'),
    path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_investigation, IncludeWebPath => 0),
);
unless ( RT->Config->Get('RTIR_DisableCountermeasures') ) {
    $root->child(
        countermeasures => title => loc('countermeasures'),
        path => '/Search/Results.html?ExtraQueryParams=RTIR&RTIR=1&Lifecycle='.RT::IR->lifecycle_countermeasure,
    )->child(
        create => title => loc('Create'),
        path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0),
    );
}

Hi!

Thanks for your answer!

Is this modification possible directly from the RT_SiteConfig.pm file?

unless ( RT->Config->Get('RTIR_DisableCountermeasures') ) {
    $root->child(
        countermeasures => title => loc('countermeasures'),
        path => '/Search/Results.html?ExtraQueryParams=RTIR&RTIR=1&Lifecycle='.RT::IR->lifecycle_countermeasure,
    )->child(
        create => title => loc('Create'),
        path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0),
    );
}

The part loc('countermeasures') uses the localisation.files (po) to find a localised name for the item. So it depends on the langueage u’re set in your preferences. It seems u’re using english-language, maybe you want to set it to French at least for single users. See “About Me”. It should use the language-tag from your brwoser by default.

If the French translation to this item is missing it is possible to change the file.

All modifikations on source should be done in the local-dir. See CustomizingWithLocalDir - Request Tracker Wiki

See also: Hacking - RT 5.0.7 Documentation - Best Practical

Language setting in AboutMe:

I see, so if I want to modify the menu text, I’ll have to modify the translation file directly?

No. Your Screenshot shows english language. So try French. In my opinion there is already a translation for French. This would be the easiest way. (I can not test it because we have no RTIR installed, just RT. RT has a french translation.)

Then if there are single words you want to change the next easiest way is to edit the language-file.

If the language-setting doesn’t work for you at all the solution is to modify the source an put in a fixed string with your preferred text, like this: countermeasures => title => "Contre-mesures"),

Basically: If you change a language-file or a source-file it is strongly recommented to copy it to the local-dir.

That example is RT French:
image

Hi!

Although I’ve put my interface in French, nothing changes in the menu: