Skip to content

Commit

Permalink
fix: i18n fixes and prep to push to Transifex (#85)
Browse files Browse the repository at this point in the history
Multiple related changes:

 - Fixed missing i18n directory when running `make extract_translations`
 - Fixed jsx duplicate FormattedMessage IDs
 - Refactored exam.examTimer.text into a single message instead of concatination
 - Removed babel.config.js to fix missing i18n plugin which causes "No messages found" error

Refs: FC-0012 OEP-58
  • Loading branch information
OmarIthawi authored Mar 28, 2023
1 parent 9888ecf commit 76df9f2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ i18n.extract:

i18n.concat:
# Gathering JSON messages into one file...
mkdir -p $(i18n)
$(transifex_utils) $(transifex_temp) $(transifex_input)

extract_translations: | requirements i18n.extract i18n.concat
Expand Down
9 changes: 0 additions & 9 deletions babel.config.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const SkipProctoredExamInstruction = ({ cancelSkipProctoredExam }) => {
</p>
<p>
<FormattedMessage
id="exam.skipProctoredExamInstructions.text1"
id="exam.skipProctoredExamInstructions.text2"
defaultMessage={'If you take this exam without proctoring, you will not be eligible for '
+ 'course credit or the MicroMasters credential if either applies to this course.'}
/>
Expand Down
19 changes: 10 additions & 9 deletions src/timer/ExamTimerBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,17 @@ const ExamTimerBlock = injectIntl(({
<div>
<FormattedMessage
id="exam.examTimer.text"
defaultMessage='You are taking "'
/>
<Alert.Link href={attempt.exam_url_path}>
{attempt.exam_display_name}
</Alert.Link>
<FormattedMessage
id="exam.examTimer.text"
defaultMessage='" as {examType}. '
values={{ examType: attempt.exam_type }}
defaultMessage='You are taking "{examLink}" as {examType}.'
values={{
examLink: (
<Alert.Link href={attempt.exam_url_path}>
{attempt.exam_display_name}
</Alert.Link>
),
examType: attempt.exam_type,
}}
/>
{' '}
{
isShowMore
? (
Expand Down

0 comments on commit 76df9f2

Please sign in to comment.