Skip to content
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

fix: update translations for instructor toolbar and masquarade widget #961

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions src/instructor-toolbar/InstructorToolbar.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { getConfig } from '@edx/frontend-platform';
import { FormattedMessage } from '@edx/frontend-platform/i18n';

import { ALERT_TYPES, AlertList } from '../generic/user-messages';
import Alert from '../generic/user-messages/Alert';
Expand Down Expand Up @@ -74,17 +75,35 @@ export default function InstructorToolbar(props) {
{(urlStudio || urlInsights) && (
<>
<hr className="border-light" />
<span className="mr-2 mt-1 col-form-label">View course in:</span>
<span className="mr-2 mt-1 col-form-label">
<FormattedMessage
id="instructorToolbar.view.label"
description="Label on the instructor toolbar."
defaultMessage="View course in:"
/>
</span>
</>
)}
{urlStudio && (
<span className="mx-1 my-1">
<a className="btn btn-inverse-outline-primary" href={urlStudio}>Studio</a>
<a className="btn btn-inverse-outline-primary" href={urlStudio}>
<FormattedMessage
id="instructorToolbar.view.mode.label.1"
description="Label view mode for studio."
defaultMessage="Studio"
/>
</a>
</span>
)}
{urlInsights && (
<span className="mx-1 my-1">
<a className="btn btn-inverse-outline-primary" href={urlInsights}>Insights</a>
<a className="btn btn-inverse-outline-primary" href={urlInsights}>
<FormattedMessage
id="instructorToolbar.view.mode.label.2"
description="Label view mode for insights."
defaultMessage="Insights"
/>
</a>
</span>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ class MasqueradeWidget extends Component {
masqueradeUsername,
} = this.state;
const specificLearnerInputText = this.props.intl.formatMessage(messages.placeholder);
const viewCourseAsTextLabel = this.props.intl.formatMessage(messages.viewCourseAs);
return (
<div className="flex-grow-1">
<div className="row">
<span className="col-auto col-form-label pl-3">View this course as:</span>
<span className="col-auto col-form-label pl-3">{viewCourseAsTextLabel}</span>
<Dropdown className="flex-shrink-1 mx-1">
<Dropdown.Toggle variant="inverse-outline-primary">
{masquerade}
Expand Down
5 changes: 5 additions & 0 deletions src/instructor-toolbar/masquerade-widget/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ const messages = defineMessages({
defaultMessage: 'Masquerade as this user',
description: 'Label for the masquerade user input',
},
viewCourseAs: {
id: 'masquerade-widget.viewCourseAs.text.label',
defaultMessage: 'View this course as:',
description: 'Label for the view this course as',
},
});

export default messages;