mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-19 18:18:27 -05:00
fix(ui,i18n): add plurality to assignment title and complete assignment (#58522)
This commit is contained in:
@@ -422,8 +422,10 @@
|
||||
"add-subtitles": "Help improve or add subtitles",
|
||||
"wrong-answer": "Sorry, that's not the right answer. Give it another try?",
|
||||
"check-answer": "Click the button below to check your answer.",
|
||||
"assignment-not-complete": "Please complete the assignments",
|
||||
"assignments": "Assignments",
|
||||
"assignment-not-complete_one": "Please complete the assignment",
|
||||
"assignment-not-complete_other": "Please complete the assignments",
|
||||
"assignments_one": "Assignment",
|
||||
"assignments_other": "Assignments",
|
||||
"question": "Question",
|
||||
"questions": "Questions",
|
||||
"answered-mcq": "You have unanswered questions and/or incorrect answers.",
|
||||
|
||||
@@ -24,7 +24,9 @@ function Assignments({
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<>
|
||||
<ChallengeHeading heading={t('learn.assignments')} />
|
||||
<ChallengeHeading
|
||||
heading={t('learn.assignments', { count: assignments.length })}
|
||||
/>
|
||||
<div className='video-quiz-options'>
|
||||
{assignments.map((assignment, index) => (
|
||||
<label className='video-quiz-option-label' key={index}>
|
||||
@@ -44,7 +46,7 @@ function Assignments({
|
||||
<>
|
||||
<Spacer size='m' />
|
||||
<div className='assignments-not-complete'>
|
||||
{t('learn.assignment-not-complete')}
|
||||
{t('learn.assignment-not-complete', { count: assignments.length })}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -30,7 +30,11 @@ test.describe('Template Challenges Show', () => {
|
||||
.click();
|
||||
|
||||
await expect(
|
||||
page.getByText(translations.learn['assignment-not-complete'])
|
||||
page.getByText(translations.learn['assignment-not-complete_one'])
|
||||
).not.toBeVisible();
|
||||
|
||||
await expect(
|
||||
page.getByText(translations.learn['assignment-not-complete_other'])
|
||||
).not.toBeVisible();
|
||||
|
||||
await expect(
|
||||
|
||||
Reference in New Issue
Block a user