Skip to content

Commit

Permalink
Fixing localisation of Reports menu and Bulk page
Browse files Browse the repository at this point in the history
  • Loading branch information
PPetky authored and sunnavy committed Feb 20, 2024
1 parent 2c3f9c0 commit 2f3797b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/RT/Interface/Web/MenuBuilder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ sub BuildMainNav {

for my $report ( @{$HTML::Mason::Commands::session{'reports_in_menu'}} ) {
$reports->child( $report->{id} =>
title => $report->{title},
title => loc( $report->{title} ),
path => $report->{path},
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/RT/Interface/Web/ReportsRegistry.pm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ our $registry = {
},
user_time => {
id => 'user_time',
title => 'User time worked',
title => 'User time worked', # loc
path => '/Reports/TimeWorkedReport.html',
},
};
Expand Down
4 changes: 2 additions & 2 deletions share/html/Admin/Global/DashboardsInMenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
my $has_right = $session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser');

my @dashboard_components = map {{ type => 'dashboard', id => $_->id, name => $_->Name, label => $_->Name }} $m->comp("/Dashboards/Elements/ListOfDashboards", IncludeSuperuserGroups => 1 );
my @report_components = map { {%$_, name => $_->{'title'}, type => 'report', label => $_->{'title'} } } @{ ListOfReports() };
my @report_components = map { { %$_, name => $_->{'title'}, type => 'report', label => loc( $_->{'title'} ) } } @{ ListOfReports() };

my ($dashboard_attr) = $sys->Attributes->Named('DashboardsInMenu');
my ($reports_attr) = RT::System->new( RT->SystemUser )->Attributes->Named('ReportsInMenu');
Expand Down Expand Up @@ -190,6 +190,6 @@

my $report_pref = $reports_attr ? $reports_attr->Content : [];

my @report_pref_sanitized = map { {%$_, name => $_->{'title'}, type => 'report', label => $_->{'title'} } } @{ $report_pref };
my @report_pref_sanitized = map { { %$_, name => $_->{'title'}, type => 'report', label => loc( $_->{'title'} ) } } @{ $report_pref };
$selected{'report'} = \@report_pref_sanitized || [];
</%init>
4 changes: 2 additions & 2 deletions share/html/Admin/Users/DashboardsInMenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
}

my @dashboard_components = map {{ type => 'dashboard', id => $_->id, name => $_->Name, label => $_->Name }} $m->comp("/Dashboards/Elements/ListOfDashboards", IncludeSuperuserGroups => 0 );
my @report_components = map { {%$_, name => $_->{'title'}, type => 'report', label => $_->{'title'} } } @{ ListOfReports() };
my @report_components = map { { %$_, name => $_->{'title'}, type => 'report', label => loc( $_->{'title'} ) } } @{ ListOfReports() };

if ($ARGS{UpdateSearches}) {
if ( $ARGS{'dashboard_id'} eq 'DashboardsInMenu' ) {
Expand Down Expand Up @@ -199,7 +199,7 @@
my ($defaults) = RT::System->new( $session{'CurrentUser'} )->Attributes->Named('ReportsInMenu');
$report_pref = $defaults ? $defaults->Content : {};
}
my @report_pref_sanitized = map { {%$_, name => $_->{'title'}, type => 'report', label => $_->{'title'} } } @{ $report_pref };
my @report_pref_sanitized = map { { %$_, name => $_->{'title'}, type => 'report', label => loc( $_->{'title'} ) } } @{ $report_pref };
$selected{'report'} = \@report_pref_sanitized || [];
</%init>

Expand Down
4 changes: 2 additions & 2 deletions share/html/Prefs/DashboardsInMenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
}

my @dashboard_components = map {{ type => 'dashboard', id => $_->id, name => $_->Name, label => $_->Name }} $m->comp("/Dashboards/Elements/ListOfDashboards", IncludeSuperuserGroups => 0 );
my @report_components = map { {%$_, name => $_->{'title'}, type => 'report', label => $_->{'title'} } } @{ ListOfReports() };
my @report_components = map { { %$_, name => $_->{'title'}, type => 'report', label => loc( $_->{'title'} ) } } @{ ListOfReports() };

if ($ARGS{UpdateSearches}) {
if ( $ARGS{'dashboard_id'} eq 'DashboardsInMenu' ) {
Expand Down Expand Up @@ -194,7 +194,7 @@
my ($defaults) = RT::System->new( $session{'CurrentUser'} )->Attributes->Named('ReportsInMenu');
$report_pref = $defaults ? $defaults->Content : [];
}
my @report_pref_sanitized = map { {%$_, name => $_->{'title'}, type => 'report', label => $_->{'title'} } } @{ $report_pref };
my @report_pref_sanitized = map { { %$_, name => $_->{'title'}, type => 'report', label => loc( $_->{'title'} ) } } @{ $report_pref };
$selected{'report'} = \@report_pref_sanitized || [];
</%INIT>

8 changes: 4 additions & 4 deletions share/html/Search/Bulk.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@
</div>
</&>

<&| /Elements/LabeledValue, Label => 'Add Cc' &>
<&| /Elements/LabeledValue, Label => loc("Add Cc") &>
<& /Elements/EmailInput, Name => "AddCc", Size=> 20, Default => $ARGS{AddCc}, AutocompleteType => 'Principals' &>
</&>

<&| /Elements/LabeledValue, Label => 'Remove Cc' &>
<&| /Elements/LabeledValue, Label => loc("Remove Cc") &>
<& /Elements/EmailInput, Name => "DeleteCc", Size=> 20, Default => $ARGS{DeleteCc}, AutocompleteType => 'Principals' &>
</&>

Expand All @@ -136,11 +136,11 @@
</div>
</&>

<&| /Elements/LabeledValue, Label => 'Add AdminCc' &>
<&| /Elements/LabeledValue, Label => loc("Add AdminCc") &>
<& /Elements/EmailInput, Name => "AddAdminCc", Size=> 20, Default => $ARGS{AddAdminCc}, AutocompleteType => 'Principals' &>
</&>

<&| /Elements/LabeledValue, Label => 'Remove AdminCc' &>
<&| /Elements/LabeledValue, Label => loc("Remove AdminCc") &>
<& /Elements/EmailInput, Name => "DeleteAdminCc", Size=> 20, Default => $ARGS{DeleteAdminCc}, AutocompleteType => 'Principals' &>
</&>

Expand Down

0 comments on commit 2f3797b

Please sign in to comment.