From 98de8fe54c8bfd104d827cac36c1b835955353e6 Mon Sep 17 00:00:00 2001 From: "Nicholas Carrigan (he/him)" Date: Thu, 4 Feb 2021 21:17:54 -0800 Subject: [PATCH] feat(i18n, client): Allow translation of cert (#40919) Modifies the certification page to be translatable. Signed-off-by: nhcarrigan --- client/i18n/locales/chinese/translations.json | 8 ++++++++ client/i18n/locales/english/translations.json | 8 ++++++++ client/i18n/locales/espanol/translations.json | 8 ++++++++ client/i18n/translations-schema.js | 8 ++++++++ .../src/client-only-routes/ShowCertification.js | 16 +++++++++------- 5 files changed, 41 insertions(+), 7 deletions(-) diff --git a/client/i18n/locales/chinese/translations.json b/client/i18n/locales/chinese/translations.json index 5d95ea600c..ef2a91a579 100644 --- a/client/i18n/locales/chinese/translations.json +++ b/client/i18n/locales/chinese/translations.json @@ -468,5 +468,13 @@ "invalid-protocol": "URL 必须以 http 或 https 开头", "url-not-image": "URL 必须直接链接到图片文件", "use-valid-url": "请使用有效的 URL" + }, + "certification": { + "certifies": "Chinese: This certifies that", + "completed": "Chinese: has successfully completed the freeCodeCamp.org", + "developer": "Chinese: Developer Certification, representing approximately", + "executive": "Chinese: Executive Director, freeCodeCamp.org", + "verify": "Chinese: Verify this certification at {{certURL}}", + "issued": "Chinese: Issued" } } diff --git a/client/i18n/locales/english/translations.json b/client/i18n/locales/english/translations.json index f51dfd150d..400a2203a5 100644 --- a/client/i18n/locales/english/translations.json +++ b/client/i18n/locales/english/translations.json @@ -468,5 +468,13 @@ "invalid-protocol": "URL must start with http or https", "url-not-image": "URL must link directly to an image file", "use-valid-url": "Please use a valid URL" + }, + "certification": { + "certifies": "This certifies that", + "completed": "has successfully completed the freeCodeCamp.org", + "developer": "Developer Certification, representing approximately", + "executive": "Executive Director, freeCodeCamp.org", + "verify": "Verify this certification at {{certURL}}", + "issued": "Issued" } } diff --git a/client/i18n/locales/espanol/translations.json b/client/i18n/locales/espanol/translations.json index ff32dfa1e7..9706dfa0fc 100644 --- a/client/i18n/locales/espanol/translations.json +++ b/client/i18n/locales/espanol/translations.json @@ -468,5 +468,13 @@ "invalid-protocol": "La URL debe comenzar con http o https", "url-not-image": "URL debes enlazar directamente a un archivo de imagen", "use-valid-url": "Utiliza un URL válido" + }, + "certification": { + "certifies": "Spanish: This certifies that", + "completed": "Spanish: has successfully completed the freeCodeCamp.org", + "developer": "Spanish: Developer Certification, representing approximately", + "executive": "Spanish: Executive Director, freeCodeCamp.org", + "verify": "Spanish: Verify this certification at {{certURL}}", + "issued": "Spanish: Issued" } } diff --git a/client/i18n/translations-schema.js b/client/i18n/translations-schema.js index 7530734244..dc7b3a1bda 100644 --- a/client/i18n/translations-schema.js +++ b/client/i18n/translations-schema.js @@ -568,6 +568,14 @@ const translationsSchema = { 'invalid-protocol': 'URL must start with http or https', 'url-not-image': 'URL must link directly to an image file', 'use-valid-url': 'Please use a valid URL' + }, + certification: { + certifies: 'This certifies that', + completed: 'has successfully completed the freeCodeCamp.org', + developer: 'Developer Certification, representing approximately', + executive: 'Executive Director, freeCodeCamp.org', + verify: 'Verify this certification at {{certURL}}', + issued: 'Issued' } }; diff --git a/client/src/client-only-routes/ShowCertification.js b/client/src/client-only-routes/ShowCertification.js index c95d5004e4..a4c4388950 100644 --- a/client/src/client-only-routes/ShowCertification.js +++ b/client/src/client-only-routes/ShowCertification.js @@ -324,7 +324,7 @@ const ShowCertification = props => {
- Issued  + {t('certification.issued')}  {format(certDate, 'MMMM d, y')}
@@ -332,17 +332,17 @@ const ShowCertification = props => {
-

This certifies that

+

{t('certification.certifies')}

{displayName}

-

has successfully completed the freeCodeCamp.org

+

{t('certification.completed')}

{certTitle}

- Developer Certification, representing approximately{' '} - {completionTime} hours of coursework + {t('certification.developer')} {completionTime} hours of + coursework

@@ -358,10 +358,12 @@ const ShowCertification = props => {

Quincy Larson

-

Executive Director, freeCodeCamp.org

+

{t('certification.executive')}

-

Verify this certification at {certURL}

+

+ {t('certification.verify', { certURL: certURL })} +