fix(ui,i18n): add plurality to assignment title and complete assignment (#58522)

This commit is contained in:
Raymond Liu
2025-02-03 00:33:36 -08:00
committed by GitHub
parent 0047f98a24
commit 0779f3e124
3 changed files with 13 additions and 5 deletions

View File

@@ -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.",

View File

@@ -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>
</>
)}

View File

@@ -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(