Skip to content

Commit

Permalink
fix: replace hardcoded strings and properly define i18n messages
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-smith-tcril committed Oct 13, 2023
1 parent 82ff0d7 commit 45256d4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const CourseFilterControls = ({
onClose={close}
>
<div className="p-1 mr-3">
<b>Refine</b>
<b>{formatMessage(messages.refine)}</b>
</div>
<hr />
<div className="filter-form-row">
Expand Down
5 changes: 3 additions & 2 deletions src/containers/CourseFilterControls/messages.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down Expand Up @@ -52,4 +52,5 @@ export const messages = StrictDict({
defaultMessage: 'Refine',
},
});

export default messages;
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export const AuthenticatedUserDropdown = () => {
</span>
</Dropdown.Toggle>
<Dropdown.Menu className="dropdown-menu-right">
<Dropdown.Header>SWITCH DASHBOARD</Dropdown.Header>
<Dropdown.Header>{formatMessage(messages.dashboardSwitch)}</Dropdown.Header>
<Dropdown.Item as="a" href="/edx-dashboard" className="active">
Personal
{formatMessage(messages.dashboardPersonal)}
</Dropdown.Item>
{!!dashboard && (
<Dropdown.Item as="a" href={dashboard.url} key={dashboard.label}>
Expand Down
10 changes: 10 additions & 0 deletions src/containers/LearnerDashboardHeader/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 45256d4

Please sign in to comment.