feat(client, i18n): add note about exam being available only in English (#53736)

Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
yoko
2024-02-20 09:55:55 +09:00
committed by GitHub
parent 8864696c35
commit cc75cdd534
3 changed files with 17 additions and 2 deletions

View File

@@ -1461,6 +1461,7 @@
"go-back-to-learn": "Go back to the stable version of the curriculum.",
"read-database-cert-article": "Please read this forum post before proceeding.",
"enable-cookies": "You must enable third-party cookies before starting.",
"english-only": "The courses in this section are only available in English. We are only able to translate the titles and introductions at the moment, not the lessons themselves."
"english-only": "The courses in this section are only available in English. We are only able to translate the titles and introductions at the moment, not the lessons themselves.",
"exam-english-only": "Please note that the certification exam is currently available only in English. The rest of the courses are available in some languages."
}
}

View File

@@ -2,7 +2,11 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import { Alert } from '@freecodecamp/ui';
import { SuperBlocks } from '../../../../../shared/config/superblocks';
import { isOldRespCert, isRelationalDbCert } from '../../../utils/is-a-cert';
import {
isOldRespCert,
isRelationalDbCert,
isExamCert
} from '../../../utils/is-a-cert';
import { Link } from '../../../components/helpers';
import { CodeAllyDown } from '../../../components/growth-book/codeally-down';
@@ -42,6 +46,12 @@ function LegacyLinks({ superBlock }: LegacyLinksProps): JSX.Element {
)}
</>
);
} else if (isExamCert(superBlock) && clientLocale != 'english') {
return (
<Alert variant='info'>
<p>{t('intro:misc-text.exam-english-only')}</p>
</Alert>
);
} else {
return (
<>

View File

@@ -7,3 +7,7 @@ export function isOldRespCert(superBlock: string): boolean {
export function isRelationalDbCert(superBlock: string): boolean {
return superBlock === String(SuperBlocks.RelationalDb);
}
export function isExamCert(superBlock: string): boolean {
return superBlock === String(SuperBlocks.FoundationalCSharp);
}