From 92528cc0b419051eafe500307d0d46a00df4d507 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Thu, 30 Nov 2023 06:37:31 -0600 Subject: [PATCH] Fix filtering the user list by permission level or status for other languages. Currently when filtering by permission level or status the text entered in the "Filter by what text?" field is matched against the untranslated permission level name or status name. As a result other languages must enter the English names for these to match what is displayed translated which is probably very confusing. This just matches against the translated names. This fixes issue #1093. --- lib/WeBWorK/ContentGenerator/Instructor/UserList.pm | 4 ++-- lib/WeBWorK/Localize.pm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm b/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm index 2f0a9f9a0a..886f8df58d 100644 --- a/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm +++ b/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm @@ -287,10 +287,10 @@ sub filter_handler ($c) { for my $userID (@{ $c->{allUserIDs} }) { if ($field eq 'permission') { push @matchingUserIDs, $userID - if ($permissionLabels{ $allUsers{$userID}{permission} } =~ /^$regex/i); + if $c->maketext($permissionLabels{ $allUsers{$userID}{permission} }) =~ /^$regex/i; } elsif ($field eq 'status') { push @matchingUserIDs, $userID - if ($ce->status_abbrev_to_name($allUsers{$userID}{status}) =~ /^$regex/i); + if $c->maketext($ce->status_abbrev_to_name($allUsers{$userID}{status})) =~ /^$regex/i; } else { push @matchingUserIDs, $userID if $allUsers{$userID}{$field} =~ /^$regex/i; } diff --git a/lib/WeBWorK/Localize.pm b/lib/WeBWorK/Localize.pm index dd0a53f8e1..3dd7a90d3a 100644 --- a/lib/WeBWorK/Localize.pm +++ b/lib/WeBWorK/Localize.pm @@ -68,7 +68,7 @@ our %Lexicon = ( x('ta'), x('professor'), x('admin'), x('nobody') ], - '_STATUS' => [ x('Enrolled'), x('Audit'), x('Drop'), x('Proctor') ], + '_STATUS' => [ x('Enrolled'), x('Audit'), x('Drop'), x('Proctor'), x('Observer') ], ); 1;