Skip to content

Commit 98de8fe

Browse files
author
Nicholas Carrigan (he/him)
authored
feat(i18n, client): Allow translation of cert (freeCodeCamp#40919)
Modifies the certification page to be translatable. Signed-off-by: nhcarrigan <[email protected]>
1 parent 1a9b791 commit 98de8fe

File tree

5 files changed

+41
-7
lines changed

5 files changed

+41
-7
lines changed

client/i18n/locales/chinese/translations.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,5 +468,13 @@
468468
"invalid-protocol": "URL 必须以 http 或 https 开头",
469469
"url-not-image": "URL 必须直接链接到图片文件",
470470
"use-valid-url": "请使用有效的 URL"
471+
},
472+
"certification": {
473+
"certifies": "Chinese: This certifies that",
474+
"completed": "Chinese: has successfully completed the freeCodeCamp.org",
475+
"developer": "Chinese: Developer Certification, representing approximately",
476+
"executive": "Chinese: Executive Director, freeCodeCamp.org",
477+
"verify": "Chinese: Verify this certification at {{certURL}}",
478+
"issued": "Chinese: Issued"
471479
}
472480
}

client/i18n/locales/english/translations.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,5 +468,13 @@
468468
"invalid-protocol": "URL must start with http or https",
469469
"url-not-image": "URL must link directly to an image file",
470470
"use-valid-url": "Please use a valid URL"
471+
},
472+
"certification": {
473+
"certifies": "This certifies that",
474+
"completed": "has successfully completed the freeCodeCamp.org",
475+
"developer": "Developer Certification, representing approximately",
476+
"executive": "Executive Director, freeCodeCamp.org",
477+
"verify": "Verify this certification at {{certURL}}",
478+
"issued": "Issued"
471479
}
472480
}

client/i18n/locales/espanol/translations.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,5 +468,13 @@
468468
"invalid-protocol": "La URL debe comenzar con http o https",
469469
"url-not-image": "URL debes enlazar directamente a un archivo de imagen",
470470
"use-valid-url": "Utiliza un URL válido"
471+
},
472+
"certification": {
473+
"certifies": "Spanish: This certifies that",
474+
"completed": "Spanish: has successfully completed the freeCodeCamp.org",
475+
"developer": "Spanish: Developer Certification, representing approximately",
476+
"executive": "Spanish: Executive Director, freeCodeCamp.org",
477+
"verify": "Spanish: Verify this certification at {{certURL}}",
478+
"issued": "Spanish: Issued"
471479
}
472480
}

client/i18n/translations-schema.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,14 @@ const translationsSchema = {
568568
'invalid-protocol': 'URL must start with http or https',
569569
'url-not-image': 'URL must link directly to an image file',
570570
'use-valid-url': 'Please use a valid URL'
571+
},
572+
certification: {
573+
certifies: 'This certifies that',
574+
completed: 'has successfully completed the freeCodeCamp.org',
575+
developer: 'Developer Certification, representing approximately',
576+
executive: 'Executive Director, freeCodeCamp.org',
577+
verify: 'Verify this certification at {{certURL}}',
578+
issued: 'Issued'
571579
}
572580
};
573581

client/src/client-only-routes/ShowCertification.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -324,25 +324,25 @@ const ShowCertification = props => {
324324
</Col>
325325
<Col md={7} sm={12}>
326326
<div data-cy='issue-date' className='issue-date'>
327-
Issued&nbsp;
327+
{t('certification.issued')}&nbsp;
328328
<strong>{format(certDate, 'MMMM d, y')}</strong>
329329
</div>
330330
</Col>
331331
</header>
332332

333333
<main className='information'>
334334
<div className='information-container'>
335-
<h3>This certifies that</h3>
335+
<h3>{t('certification.certifies')}</h3>
336336
<h1>
337337
<strong>{displayName}</strong>
338338
</h1>
339-
<h3>has successfully completed the freeCodeCamp.org</h3>
339+
<h3>{t('certification.completed')}</h3>
340340
<h1>
341341
<strong>{certTitle}</strong>
342342
</h1>
343343
<h4>
344-
Developer Certification, representing approximately{' '}
345-
{completionTime} hours of coursework
344+
{t('certification.developer')} {completionTime} hours of
345+
coursework
346346
</h4>
347347
</div>
348348
</main>
@@ -358,10 +358,12 @@ const ShowCertification = props => {
358358
<p>
359359
<strong>Quincy Larson</strong>
360360
</p>
361-
<p>Executive Director, freeCodeCamp.org</p>
361+
<p>{t('certification.executive')}</p>
362362
</div>
363363
<Row>
364-
<p className='verify'>Verify this certification at {certURL}</p>
364+
<p className='verify'>
365+
{t('certification.verify', { certURL: certURL })}
366+
</p>
365367
</Row>
366368
</footer>
367369
</Row>

0 commit comments

Comments
 (0)