Skip to content

Commit

Permalink
馃悰(frontend) fix Enroll now translation
Browse files Browse the repository at this point in the history
When using an external LMS, the CTA Enroll now on course runs
isn't being translated.
  • Loading branch information
igobranco committed Jan 23, 2024
1 parent 137c9ef commit 042d91b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Versioning](https://semver.org/spec/v2.0.0.html).

- Switch from setup.cfg to pyproject.toml

### Fixed

- Fix frontend translation of Enroll now for external LMS backend

## [2.25.0-beta.1]

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import CourseRunEnrollment from '../CourseRunEnrollment';
import CourseProductItem from '../CourseProductItem';

const messages = defineMessages({
enroll: {
id: 'components.SyllabusCourseRun.enroll',
description: 'CTA for users to enroll in the course run for external LMS backend.',
defaultMessage: 'Enroll now',
},
enrollment: {
id: 'components.SyllabusCourseRun.enrollment',
description: 'Title of the enrollment dates section of an opened course run block',
Expand Down Expand Up @@ -84,7 +89,7 @@ const OpenedCourseRun = ({ courseRun }: { courseRun: CourseRun }) => {
<CourseRunEnrollment courseRun={courseRun} />
) : (
<a className="course-run-enrollment__cta" href={courseRun.resource_link}>
{StringHelper.capitalizeFirst(courseRun.state.call_to_action)}
<FormattedMessage {...messages.enroll} />
</a>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import JoanieApiProvider from 'contexts/JoanieApiContext';
import { CourseProductRelation } from 'types/Joanie';
import { CourseLightFactory, CourseProductRelationFactory } from 'utils/test/factories/joanie';
import { DEFAULT_DATE_FORMAT } from 'hooks/useDateFormat';
import { StringHelper } from 'utils/StringHelper';
import { computeStates } from 'utils/CourseRuns';
import { User } from 'types/User';
import { Nullable } from 'types/utils';
Expand Down Expand Up @@ -138,7 +137,7 @@ describe('<SyllabusCourseRunsList/>', () => {

expect(languagesContainer.nextSibling).toBeNull();
getByRole(runContainer, 'link', {
name: StringHelper.capitalizeFirst(courseRun.state.call_to_action)!,
name: 'Enroll now',
});
};

Expand Down

0 comments on commit 042d91b

Please sign in to comment.