feat: i18n-ize messages (Merge pull request #20 from muselesscreator/i18n)
Feat: I18n-ize messages
This commit is contained in:
@@ -18,13 +18,6 @@ export const gradingStatuses = StrictDict({
|
||||
inProgress: lockStatuses.inProgress,
|
||||
});
|
||||
|
||||
export const gradingStatusDisplay = StrictDict({
|
||||
[gradingStatuses.ungraded]: 'Ungraded',
|
||||
[gradingStatuses.locked]: 'Currently being graded by someone else',
|
||||
[gradingStatuses.graded]: 'Grading Complete',
|
||||
[gradingStatuses.inProgress]: 'You are currently grading this response',
|
||||
});
|
||||
|
||||
export const feedbackRequirement = StrictDict({
|
||||
disabled: 'disabled',
|
||||
required: 'required',
|
||||
|
||||
34
src/data/services/lms/messages.js
Normal file
34
src/data/services/lms/messages.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import { defineMessages } from '@edx/frontend-platform/i18n';
|
||||
import { gradingStatuses } from './constants';
|
||||
|
||||
const messages = defineMessages({
|
||||
ungraded: {
|
||||
id: 'ora-grading.lms-api.gradingStatusDisplay.ungraded',
|
||||
defaultMessage: 'Ungraded',
|
||||
description: 'Grading status label for ungraded submission',
|
||||
},
|
||||
locked: {
|
||||
id: 'ora-grading.lms-api.gradingStatusDisplay.locked',
|
||||
defaultMessage: 'Currently being graded by someone else',
|
||||
description: 'Grading status label for locked submission',
|
||||
},
|
||||
graded: {
|
||||
id: 'ora-grading.lms-api.gradingStatusDisplay.graded',
|
||||
defaultMessage: 'Grading Completed',
|
||||
description: 'Grading status label for graded submission',
|
||||
},
|
||||
inProgress: {
|
||||
id: 'ora-grading.lms-api.gradingStatusDisplay.inProgress',
|
||||
defaultMessage: 'You are currently grading this response',
|
||||
description: 'Grading status label for in-progress submission',
|
||||
},
|
||||
});
|
||||
|
||||
// re-keying the messages to ensure that the api can link to them even if the passed
|
||||
// status keys change.
|
||||
export default {
|
||||
[gradingStatuses.ungraded]: messages.ungraded,
|
||||
[gradingStatuses.locked]: messages.locked,
|
||||
[gradingStatuses.graded]: messages.graded,
|
||||
[gradingStatuses.inProgress]: messages.inProgress,
|
||||
};
|
||||
Reference in New Issue
Block a user