-
Notifications
You must be signed in to change notification settings - Fork 78
feat(translations): translate course user roles #8199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
CourseUserRolestype 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
injectIntlHOC pattern to theuseTranslationhook - Removed hard-coded
COURSE_USER_ROLESconstant 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.
client/app/bundles/course/user-invitations/components/forms/IndividualInvitation.tsx
Outdated
Show resolved
Hide resolved
client/app/bundles/course/user-invitations/components/forms/IndividualInvitation.tsx
Outdated
Show resolved
Hide resolved
client/app/bundles/course/users/components/tables/ManageUsersTable/RoleMenu.tsx
Outdated
Show resolved
Hide resolved
client/app/bundles/course/users/components/tables/ManageUsersTable/RoleMenu.tsx
Outdated
Show resolved
Hide resolved
53f1cdb to
7ac1017
Compare
7ac1017 to
e707339
Compare
There was a problem hiding this 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.
No description provided.