From c2a20af9b8cc37460139b91b95e6253a6e9d4524 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Fri, 13 Oct 2023 16:34:01 -0400 Subject: [PATCH] fix: replace hardcoded strings and properly define i18n messages --- .../CourseFilterControls/CourseFilterControls.jsx | 2 +- src/containers/CourseFilterControls/messages.js | 5 +++-- .../ExpandedHeader/AuthenticatedUserDropdown.jsx | 4 ++-- src/containers/LearnerDashboardHeader/messages.js | 10 ++++++++++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/containers/CourseFilterControls/CourseFilterControls.jsx b/src/containers/CourseFilterControls/CourseFilterControls.jsx index c4a774a4..03b420d4 100644 --- a/src/containers/CourseFilterControls/CourseFilterControls.jsx +++ b/src/containers/CourseFilterControls/CourseFilterControls.jsx @@ -68,7 +68,7 @@ export const CourseFilterControls = ({ onClose={close} >
- Refine + {formatMessage(messages.refine)}

diff --git a/src/containers/CourseFilterControls/messages.js b/src/containers/CourseFilterControls/messages.js index fa368292..af895dca 100644 --- a/src/containers/CourseFilterControls/messages.js +++ b/src/containers/CourseFilterControls/messages.js @@ -1,6 +1,6 @@ -import { StrictDict } from 'utils'; +import { defineMessages } from '@edx/frontend-platform/i18n'; -export const messages = StrictDict({ +const messages = defineMessages({ inProgress: { id: 'learner-dash.courseListFilters.inProgress', description: 'in-progress filter checkbox label for course list filters', @@ -52,4 +52,5 @@ export const messages = StrictDict({ defaultMessage: 'Refine', }, }); + export default messages; diff --git a/src/containers/LearnerDashboardHeader/ExpandedHeader/AuthenticatedUserDropdown.jsx b/src/containers/LearnerDashboardHeader/ExpandedHeader/AuthenticatedUserDropdown.jsx index e84cb468..eaa74486 100644 --- a/src/containers/LearnerDashboardHeader/ExpandedHeader/AuthenticatedUserDropdown.jsx +++ b/src/containers/LearnerDashboardHeader/ExpandedHeader/AuthenticatedUserDropdown.jsx @@ -29,9 +29,9 @@ export const AuthenticatedUserDropdown = () => { - SWITCH DASHBOARD + {formatMessage(messages.dashboardSwitch)} - Personal + {formatMessage(messages.dashboardPersonal)} {!!dashboard && ( diff --git a/src/containers/LearnerDashboardHeader/messages.js b/src/containers/LearnerDashboardHeader/messages.js index 8ac4e04a..08c71cd7 100644 --- a/src/containers/LearnerDashboardHeader/messages.js +++ b/src/containers/LearnerDashboardHeader/messages.js @@ -6,6 +6,16 @@ const messages = defineMessages({ defaultMessage: 'Dashboard', description: 'The text for the user menu Dashboard navigation link.', }, + dashboardPersonal: { + id: 'learnerVariantDashboard.menu.dashboardPersonal.label', + defaultMessage: 'Personal', + description: 'Link to personal dashboard in user menu', + }, + dashboardSwitch: { + id: 'learnerVariantDashboard.menu.dashboardSwitch.label', + defaultMessage: 'SWITCH DASHBOARD', + description: 'Switch Dashboard header in the user menu', + }, help: { id: 'learnerVariantDashboard.help.label', defaultMessage: 'Help',