Skip to content

Conversation

@adi-herwana-nus
Copy link
Contributor

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements internationalization for course user roles by replacing hard-coded English strings with proper translation keys. The changes enable role names to be displayed in the user's selected language (English, Chinese, Korean).

Key changes:

  • Refactored CourseUserRoles type from a union to a const array pattern, enabling better type inference
  • Created a new translations file for role names with proper i18n keys
  • Migrated components from injectIntl HOC pattern to the useTranslation hook
  • Removed hard-coded COURSE_USER_ROLES constant from sharedConstants.ts

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
client/locales/en.json Added English translations for 5 course user roles
client/locales/zh.json Added Chinese translations for 5 course user roles
client/locales/ko.json Added Korean translations for 5 course user roles
client/app/lib/translations/course/users/roles.ts New file defining translation keys for all course user roles
client/app/types/course/courseUsers.ts Refactored types from union to const array pattern (CourseUserRoles → CourseUserRole)
client/app/lib/constants/sharedConstants.ts Removed hard-coded COURSE_USER_ROLES and STAFF_ROLES objects
client/app/bundles/users/components/tables/CoursesTable.tsx Migrated to useTranslation hook and role translations
client/app/bundles/course/users/components/tables/ManageUsersTable/index.tsx Updated to use translated role names in CSV export
client/app/bundles/course/users/components/tables/ManageUsersTable/RoleMenu.tsx Migrated to useTranslation and dynamic role menu generation
client/app/bundles/course/users/components/misc/UserProfileCard.tsx Migrated to useTranslation hook for displaying user role
client/app/bundles/course/users/components/misc/UpgradeToStaff.tsx Migrated to useTranslation with proper role selection using COURSE_STAFF_ROLES
client/app/bundles/course/users/components/buttons/UserManagementButtons.tsx Migrated to useTranslation for role display in delete confirmations
client/app/bundles/course/user-invitations/components/tables/UserInvitationsTable.tsx Migrated to useTranslation for role display in invitations table
client/app/bundles/course/user-invitations/components/tables/InvitationResultUsersTable.tsx Migrated to useTranslation for role display in results
client/app/bundles/course/user-invitations/components/tables/InvitationResultInvitationsTable.tsx Migrated to useTranslation for role display
client/app/bundles/course/user-invitations/components/forms/IndividualInvitation.tsx Partially migrated - uses COURSE_USER_ROLES constant for role options
client/app/bundles/course/enrol-requests/components/tables/EnrolRequestsTable.tsx Migrated to useTranslation for role display and selection
client/app/bundles/course/enrol-requests/components/buttons/PendingEnrolRequestsButtons.tsx Migrated to useTranslation for role display in confirmations
client/app/bundles/course/container/Sidebar/CourseUserItem.tsx Migrated to useTranslation with proper null checking for optional courseUserRole
client/app/bundles/course/users/selectors.ts Updated to use COURSE_STAFF_ROLES constant for filtering
client/app/bundles/course/users/operations.ts Updated type references from StaffRoles to CourseStaffRole
client/app/api/course/Users.ts Updated API method parameter type from StaffRoles to CourseStaffRole
client/app/types/users.ts Updated type references from CourseUserRoles to CourseUserRole
client/app/types/course/enrolRequests.ts Updated type references from CourseUserRoles to CourseUserRole
client/app/types/course/courses.ts Updated type references from CourseUserRoles to CourseUserRole
client/app/bundles/course/users/pages/UserStatistics/index.tsx Updated type references from CourseUserRoles to CourseUserRole
client/app/bundles/course/group/types.ts Updated type references from CourseUserRoles to CourseUserRole

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@adi-herwana-nus adi-herwana-nus force-pushed the adi/translate-course-user-roles branch from 53f1cdb to 7ac1017 Compare January 9, 2026 01:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants